Changeset 29559 in osm for applications
- Timestamp:
- 2013-05-06T01:26:22+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/reverter/src/reverter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java
r29553 r29559 423 423 OsmPrimitive p = ds.getPrimitiveById(id); 424 424 if (p instanceof Node && p.getVersion() > 1) { 425 final OsmServerMultiObjectReader rdr = new OsmServerMultiObjectReader(); 426 readObjectVersion(rdr, id, p.getVersion()-1, progressMonitor); 427 Collection<OsmPrimitive> result = rdr.parseOsm(progressMonitor.createSubTaskMonitor(1, true)).allPrimitives(); 428 if (!result.isEmpty()) { 429 n.setCoor(((Node)result.iterator().next()).getCoor()); 425 LatLon coor = ((Node)p).getCoor(); 426 if (coor == null) { 427 final OsmServerMultiObjectReader rdr = new OsmServerMultiObjectReader(); 428 readObjectVersion(rdr, id, p.getVersion()-1, progressMonitor); 429 Collection<OsmPrimitive> result = rdr.parseOsm(progressMonitor.createSubTaskMonitor(1, true)).allPrimitives(); 430 if (!result.isEmpty()) { 431 coor = ((Node)result.iterator().next()).getCoor(); 432 } 430 433 } 434 if (coor != null) { 435 n.setCoor(coor); 436 } 431 437 } 432 438 } -
applications/editors/josm/plugins/reverter/src/reverter/DataSetCommandMerger.java
r23273 r29559 41 41 merge(); 42 42 } 43 44 private void addChangeCommandIfNotEquals(OsmPrimitive target, OsmPrimitive newTarget) { 45 if (!target.hasEqualSemanticAttributes(newTarget)) { 46 cmds.add(new ChangeCommand(target,newTarget)); 47 } 48 } 43 49 44 50 private OsmPrimitive getMergeTarget(OsmPrimitive mergeSource) { … … 69 75 Node newTarget = new Node(target); 70 76 mergePrimitive(source, target, newTarget); 71 cmds.add(new ChangeCommand(target,newTarget));77 addChangeCommandIfNotEquals(target,newTarget); 72 78 } 73 79 … … 93 99 Node undeletedTargetNode = new Node(targetNode); 94 100 undeletedTargetNode.setDeleted(false); 95 cmds.add(new ChangeCommand(targetNode,undeletedTargetNode));101 addChangeCommandIfNotEquals(targetNode,undeletedTargetNode); 96 102 } 97 103 newNodes.add(targetNode); … … 100 106 mergePrimitive(source, target, newTarget); 101 107 newTarget.setNodes(newNodes); 102 cmds.add(new ChangeCommand(target,newTarget));108 addChangeCommandIfNotEquals(target,newTarget); 103 109 } 104 110 … … 128 134 } 129 135 undeletedTargetMember.setDeleted(false); 130 cmds.add(new ChangeCommand(targetMember,undeletedTargetMember));136 addChangeCommandIfNotEquals(targetMember,undeletedTargetMember); 131 137 } 132 138 newMembers.add(new RelationMember(sourceMember.getRole(), targetMember)); … … 135 141 mergePrimitive(source, target, newRelation); 136 142 newRelation.setMembers(newMembers); 137 cmds.add(new ChangeCommand(target,newRelation));143 addChangeCommandIfNotEquals(target,newRelation); 138 144 } 145 139 146 private void merge() { 140 147 for (Node node: sourceDataSet.getNodes()) {
Note:
See TracChangeset
for help on using the changeset viewer.