Changeset 2377 in josm for trunk/src/org
- Timestamp:
- 2009-11-01T19:34:42+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r2291 r2377 168 168 private OsmPrimitiveData current; 169 169 private String generator; 170 171 protected void fixLegacyVersion(Attributes atts) throws SAXException { 172 if (ds.version.equals("0.6") && atts.getValue("version") == null) { 173 throwException( 174 tr("Mandatory attribute ''version'' missing for object with id {0}.", current.id) 175 ); 176 } else if (ds.version.equals("0.5") && atts.getValue("version") == null) { 177 // legacy mode. 0.5 data might not have version attribute. Init with 178 // default value 1 179 // 180 current.version = 1; 181 } 182 } 170 183 171 184 @Override public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { … … 214 227 current.latlon = new LatLon(getDouble(atts, "lat"), getDouble(atts, "lon")); 215 228 readCommon(atts, current); 229 fixLegacyVersion(atts); 216 230 Node n = current.createNode(); 217 231 externalIdMap.put("n"+current.id, n); … … 219 233 current = new OsmPrimitiveData(); 220 234 readCommon(atts, current); 235 fixLegacyVersion(atts); 221 236 Way w = current.createWay(); 222 237 externalIdMap.put("w"+current.id, w); … … 247 262 current = new OsmPrimitiveData(); 248 263 readCommon(atts, current); 264 fixLegacyVersion(atts); 249 265 Relation r = current.createRelation(); 250 266 externalIdMap.put("r"+current.id, r );
Note:
See TracChangeset
for help on using the changeset viewer.