Ticket #24745: 24745.patch

File 24745.patch, 1.2 KB (added by GerdP, 2 weeks ago)

add check to prevent duplicated points with equal coordinates in exported gpx

  • src/org/openstreetmap/josm/actions/relation/ExportRelationToGpxAction.java

     
    175175                    if (wayConnectionType.direction == WayConnectionType.Direction.BACKWARD)
    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.size() > 0) {
     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                    }
    181188                }