Changeset 2396 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2009-11-07T07:26:15+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmExporter.java
r2181 r2396 66 66 Writer writer = new OutputStreamWriter(out, "UTF-8"); 67 67 68 OsmWriter w = new OsmWriter(new PrintWriter(writer), false, layer.data. version);68 OsmWriter w = new OsmWriter(new PrintWriter(writer), false, layer.data.getVersion()); 69 69 w.header(); 70 70 w.writeDataSources(layer.data); -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r2382 r2396 184 184 // save generator attribute for later use when creating DataSource objects 185 185 generator = atts.getValue("generator"); 186 ds. version = v;186 ds.setVersion(v); 187 187 188 188 } else if (qName.equals("bounds")) { … … 348 348 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.id), version)); 349 349 } 350 if (ds. version.equals("0.6")){350 if (ds.getVersion().equals("0.6")){ 351 351 if (current.version <= 0 && current.id > 0) { 352 352 throwException(tr("Illegal value for attribute ''version'' on OSM primitive with ID {0}. Got {1}.", Long.toString(current.id), version)); … … 355 355 current.version = 0; 356 356 } 357 } else if (ds. version.equals("0.5")) {357 } else if (ds.getVersion().equals("0.5")) { 358 358 if (current.version <= 0 && current.id > 0) { 359 359 System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 1, "0.5")); … … 365 365 } else { 366 366 // should not happen. API version has been checked before 367 throwException(tr("Unknown or unsupported API version. Got {0}.", ds. version));367 throwException(tr("Unknown or unsupported API version. Got {0}.", ds.getVersion())); 368 368 } 369 369 } else { 370 370 // version expected for OSM primitives with an id assigned by the server (id > 0), since API 0.6 371 371 // 372 if (current.id > 0 && ds. version != null && ds.version.equals("0.6")) {372 if (current.id > 0 && ds.getVersion() != null && ds.getVersion().equals("0.6")) { 373 373 throwException(tr("Missing attribute ''version'' on OSM primitive with ID {0}.", Long.toString(current.id))); 374 } else if (current.id > 0 && ds. version != null && ds.version.equals("0.5")) {374 } else if (current.id > 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) { 375 375 // default version in 0.5 files for existing primitives 376 376 System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 1, "0.5")); 377 377 current.version= 1; 378 } else if (current.id <= 0 && ds. version != null && ds.version.equals("0.5")) {378 } else if (current.id <= 0 && ds.getVersion() != null && ds.getVersion().equals("0.5")) { 379 379 // default version in 0.5 files for new primitives 380 380 System.out.println(tr("WARNING: Normalizing value of attribute ''version'' of element {0} to {2}, API version is ''{3}''. Got {1}.", current.id, current.version, 0, "0.5"));
Note:
See TracChangeset
for help on using the changeset viewer.