Hi,

I just had a short look at the patch that is attached to the ticket, assuming it contains the code you used to split things.

I did not have a deep look at it, but from what I can tell, you copy over the waypoints to a new layer.

Mind that this should not be done. New WayPoints always need to be created for the new layer. So you need to call the WayPoint copy constructor for every waypoint you add to the new layer.

The connectivity is cached using those waypoint objects.

Michael

On 15.09.2018 03:48, Niklas B wrote:
(maybe this time..?)

Hi,

I'm currently implementing an option to cut overlapping GPX tracks when
merging them into one layer (followup of #16681
<https://josm.openstreetmap.de/ticket/16681> "*allow multiple tracks to be
processed and prioritized (from different sources, e.g. GPS + phone +
Google Timeline)*", but when merging layers because this is not
specifically related to geotagging / geoimage layers).

Everything works fine, but the resulting GPX layer is not displayed
correctly: Some lines are displayed between tracks that are not connected
anymore (because another track was on top of it, so the underlying track
needed to be split) and also some weird lines connecting points that were
never connected appear - haven't figured them out yet.

Before I debug that any further: What caching mechanisms are there in
place, what do I have to reset? I'm already calling invalidate() (in
GpxData, which calls the appropriate listeners) and tried removing the
cached "dir" values from all of the waypoints, but it didn't help.
The layer will however be displayed perfectly fine if it's converted to a
data layer (and back) or saved as GPX and reloaded.

Any ideas on what might be the reason for that?

Thanks,
Niklas (Bjoeni)


Reply via email to