Ignore:
Timestamp:
2006-03-22T19:13:05+01:00 (20 years ago)
Author:
imi
Message:

fixed "segment completly out of map" - problem

File:
1 edited

Legend:

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

    r65 r66  
    1515import org.xml.sax.Attributes;
    1616import org.xml.sax.SAXException;
    17 import org.xml.sax.SAXParseException;
    1817
    1918import uk.co.wilson.xml.MinML2;
     
    7776                                        throw new SAXException("Unknown version: "+atts.getValue("version"));
    7877                        } else if (qName.equals("node")) {
    79                                 Node n = new Node();
    80                                 n.coor = new GeoPoint(getDouble(atts, "lat"), getDouble(atts, "lon"));
     78                                Node n = new Node(new GeoPoint(getDouble(atts, "lat"), getDouble(atts, "lon")));
    8179                                current = n;
    8280                                readCommon(atts);
     
    9492                        } else if (qName.equals("seg")) {
    9593                                if (current instanceof Way) {
    96                                         LineSegment ls = lineSegments.get(getLong(atts, "id"));
    97                                         if (ls == null)
    98                                                 fatalError(new SAXParseException("Line segment "+getLong(atts, "id")+" has not been transfered before.", null));
     94                                        long id = getLong(atts, "id");
     95                                        LineSegment ls = lineSegments.get(id);
     96                                        if (ls == null) {
     97                                                ls = new LineSegment(id); // incomplete line segment
     98                                                lineSegments.put(id, ls);
     99                                                adder.visit(ls);
     100                                        }
    99101                                        ((Way)current).segments.add(ls);
    100102                                }
Note: See TracChangeset for help on using the changeset viewer.