Changeset 19577 in josm for trunk/src/org


Ignore:
Timestamp:
2026-06-02T07:25:29+02:00 (3 days ago)
Author:
GerdP
Message:

fix #24745: Route GPX-export: Duplicate track points

  • add check to prevent duplicated points with equal coordinates in exported gpx track or converted gpx layer
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java

    r18211 r19577  
    176176                        Collections.reverse(ln);
    177177                    for (Node n: ln) {
    178                         trkseg.add(OsmDataLayer.nodeToWayPoint(n, TimeUnit.SECONDS.toMillis(time)));
     178                        WayPoint point = OsmDataLayer.nodeToWayPoint(n, TimeUnit.SECONDS.toMillis(time));
     179                        if (!trkseg.isEmpty()) {
     180                            // see #24745 don't add connecting way nodes twice
     181                            WayPoint last = trkseg.get(trkseg.size() - 1);
     182                            if (point.getCoor().equals(last.getCoor()))
     183                                continue;
     184                        }
     185                        trkseg.add(point);
    179186                        time += 1;
    180187                    }
Note: See TracChangeset for help on using the changeset viewer.