#16755 closed enhancement (fixed)
[Patch] Cut overlapping GPX layers when merging
Reported by: | Bjoeni | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 18.10 |
Component: | Core | Version: | |
Keywords: | gpx merging | Cc: |
Description (last modified by )
followup of #16681
Ideas that could implemented in the future
[...]
allow multiple tracks to be processed and prioritized (from different sources, e.g. GPS + phone + Google Timeline) [cut overlapping parts of less important tracks and replace by more important ones -> merge before handling]
This patch allows the user to cut timewise overlapping tracks and to connect them on the cuts when merging layers.
I had to modify the AbstractMergeAction
: I kept it abstract and all public signatures the same, but please have a closer look at that before patching.
Dialogs:
Example:
These are also the files used for unit tests, see patch.
Attachments (6)
Change History (12)
by , 6 years ago
Attachment: | example-original.png added |
---|
by , 6 years ago
Attachment: | example-merged-con.png added |
---|
by , 6 years ago
Attachment: | example-merged.png added |
---|
by , 6 years ago
Attachment: | dialog-target.png added |
---|
by , 6 years ago
Attachment: | dialog-prioritize.png added |
---|
comment:1 by , 6 years ago
Description: | modified (diff) |
---|
by , 6 years ago
Attachment: | MergeGPXV1.diff added |
---|
comment:2 by , 6 years ago
Milestone: | → 18.10 |
---|
comment:3 by , 6 years ago
This could be rewritten as a single line with Java 8 stream API:
boolean ogpx = true; for (Layer l : targetLayers) { if (!(l instanceof GpxLayer)) { ogpx = false; break; } } final boolean onlygpx = ogpx;
comment:4 by , 6 years ago
The new method GpxData.mergeFrom(GpxData other, boolean cutOverlapping, boolean connect) is too big. The algorithm should be split in several methods, it's hard to maintain methods with 116 lines.
Otherwise looks good!
Sorry for delay I missed that one.