Changeset 34827 in osm for applications/editors/josm/plugins
- Timestamp:
- 2019-01-16T09:18:48+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/o5m/src/org/openstreetmap/josm/plugins/o5m/io/O5mReader.java
r34820 r34827 18 18 import org.openstreetmap.josm.data.coor.LatLon; 19 19 import org.openstreetmap.josm.data.osm.DataSet; 20 import org.openstreetmap.josm.data.osm.Node ;20 import org.openstreetmap.josm.data.osm.NodeData; 21 21 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 22 import org.openstreetmap.josm.data.osm.Relation ;22 import org.openstreetmap.josm.data.osm.RelationData; 23 23 import org.openstreetmap.josm.data.osm.RelationMemberData; 24 24 import org.openstreetmap.josm.data.osm.User; 25 import org.openstreetmap.josm.data.osm.Way ;25 import org.openstreetmap.josm.data.osm.WayData; 26 26 import org.openstreetmap.josm.data.osm.UploadPolicy; 27 27 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; … … 257 257 if (version == 0) 258 258 discourageUpload = true; 259 Node node = new Node(lastNodeId, version == 0 ? 1 : version);260 n ode.setCoor(new LatLon(flat, flon).getRoundedToOsmPrecision());261 262 263 checkCoordinates(n ode.getCoor());259 NodeData nd = new NodeData(lastNodeId); 260 nd.setVersion(version == 0 ? 1 : version); 261 nd.setCoor(new LatLon(flat, flon).getRoundedToOsmPrecision()); 262 263 checkCoordinates(nd.getCoor()); 264 264 checkChangesetId(lastChangeSet); 265 n ode.setChangesetId((int) lastChangeSet);265 nd.setChangesetId((int) lastChangeSet); 266 266 // User id 267 267 if (lastTs != 0) { 268 268 checkTimestamp(lastTs); 269 n ode.setTimestamp(new Date(lastTs * 1000));269 nd.setTimestamp(new Date(lastTs * 1000)); 270 270 if (osmUser != null) 271 n ode.setUser(osmUser);271 nd.setUser(osmUser); 272 272 } 273 273 if (bytesToRead > 0) { 274 274 Map<String, String> keys = readTags(); 275 node.setKeys(keys); 276 } 277 externalIdMap.put(node.getPrimitiveId(), node); 275 nd.setKeys(keys); 276 } 277 buildPrimitive(nd); 278 278 279 } catch (IllegalDataException e) { 279 280 exception = e; … … 299 300 if (version == 0) 300 301 discourageUpload = true; 301 final Way way = new Way(lastWayId, version == 0 ? 1 : version); 302 final WayData wd = new WayData(lastWayId); 303 wd.setVersion(version == 0 ? 1 : version); 302 304 checkChangesetId(lastChangeSet); 303 w ay.setChangesetId((int) lastChangeSet);305 wd.setChangesetId((int) lastChangeSet); 304 306 // User id 305 307 if (lastTs != 0) { 306 308 checkTimestamp(lastTs); 307 w ay.setTimestamp(new Date(lastTs * 1000));309 wd.setTimestamp(new Date(lastTs * 1000)); 308 310 if (osmUser != null) 309 w ay.setUser(osmUser);311 wd.setUser(osmUser); 310 312 } 311 313 … … 320 322 321 323 Map<String, String> keys = readTags(); 322 w ay.setKeys(keys);323 ways.put(w ay.getUniqueId(), nodeIds);324 externalIdMap.put(way.getPrimitiveId(), way);324 wd.setKeys(keys); 325 ways.put(wd.getUniqueId(), nodeIds); 326 buildPrimitive(wd); 325 327 } catch (IllegalDataException e) { 326 328 exception = e; … … 345 347 if (version == 0) 346 348 discourageUpload = true; 347 final Relation rel = new Relation(lastRelId, version == 0 ? 1 : version); 349 final RelationData rel = new RelationData(lastRelId); 350 rel.setVersion(version == 0 ? 1 : version); 348 351 checkChangesetId(lastChangeSet); 349 352 rel.setChangesetId((int) lastChangeSet); … … 378 381 rel.setKeys(keys); 379 382 relations.put(rel.getUniqueId(), members); 380 externalIdMap.put(rel.getPrimitiveId(),rel);383 buildPrimitive(rel); 381 384 } catch (IllegalDataException e) { 382 385 exception = e;
Note:
See TracChangeset
for help on using the changeset viewer.