Ignore:
Timestamp:
2023-08-23T13:53:32+02:00 (15 months ago)
Author:
taylor.smock
Message:

See #22652, r18817: Stop parsing gpx files when point elements have invalid coordinates

This adds back the wpt check that was temporarily removed in r18818 to get back
to the previous "known good" state and additionally adds checks for rtept and
trkpt elements.

This also removes a change to build.xml that was accidentally committed in r18818.
The specific change (adding Automatic-Module-Name to the JOSM manifest) will
probably be done in a separate commit in the future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/GpxParser.java

    r18818 r18819  
    638638                currentState = states.pop();
    639639                convertUrlToLink(currentWayPoint.attr);
     640                if (!currentWayPoint.isLatLonKnown()) {
     641                    throw new SAXException(tr("{0} element does not have valid latitude and/or longitude.", localName));
     642                }
    640643                currentRoute.routePoints.add(currentWayPoint);
    641644                break;
     
    643646                currentState = states.pop();
    644647                convertUrlToLink(currentWayPoint.attr);
     648                if (!currentWayPoint.isLatLonKnown()) {
     649                    throw new SAXException(tr("{0} element does not have valid latitude and/or longitude.", localName));
     650                }
    645651                currentTrackSeg.add(currentWayPoint);
    646652                break;
     
    649655                convertUrlToLink(currentWayPoint.attr);
    650656                currentWayPoint.getExtensions().addAll(currentExtensionCollection);
     657                if (!currentWayPoint.isLatLonKnown()) {
     658                    currentExtensionCollection.clear();
     659                    throw new SAXException(tr("{0} element does not have valid latitude and/or longitude.", localName));
     660                }
    651661                data.waypoints.add(currentWayPoint);
    652662                currentExtensionCollection.clear();
Note: See TracChangeset for help on using the changeset viewer.