Changeset 5326 in josm


Ignore:
Timestamp:
2012-07-12T08:45:22+02:00 (12 years ago)
Author:
framm
Message:

handle deleted nodes without lat/lon. apply patches from ticket; closes #7847

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/Node.java

    r5249 r5326  
    178178    void setDataset(DataSet dataSet) {
    179179        super.setDataset(dataSet);
    180         if (!isIncomplete() && (getCoor() == null || getEastNorth() == null))
     180        if (!isIncomplete() && isVisible() && (getCoor() == null || getEastNorth() == null))
    181181            throw new DataIntegrityProblemException("Complete node with null coordinates: " + toString() + get3892DebugInfo());
    182182    }
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r5266 r5326  
    178178    protected Node parseNode() throws XMLStreamException {
    179179        NodeData nd = new NodeData();
    180         nd.setCoor(new LatLon(Double.parseDouble(parser.getAttributeValue(null, "lat")), Double.parseDouble(parser.getAttributeValue(null, "lon"))));
     180        String lat = parser.getAttributeValue(null, "lat");
     181        String lon = parser.getAttributeValue(null, "lon");
     182        if (lat != null && lon != null) {
     183            nd.setCoor(new LatLon(Double.parseDouble(lat), Double.parseDouble(lon)));
     184        }
    181185        readCommon(nd);
    182186        Node n = new Node(nd.getId(), nd.getVersion());
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r5025 r5326  
    136136        if (n.isIncomplete()) return;
    137137        addCommon(n, "node");
    138         out.print(" lat='"+n.getCoor().lat()+"' lon='"+n.getCoor().lon()+"'");
     138        if (n.getCoor() != null) {
     139            out.print(" lat='"+n.getCoor().lat()+"' lon='"+n.getCoor().lon()+"'");
     140        }
    139141        if (!withBody) {
    140142            out.println("/>");
Note: See TracChangeset for help on using the changeset viewer.