Changeset 3040 in josm for trunk/src/org
- Timestamp:
- 2010-02-25T00:18:42+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r3039 r3040 35 35 /** 36 36 * A map of all primitives that got replaced with other primitives. 37 * Key is the primitive id in their dataset, the value is the id in my dataset38 */ 39 private final Map< Long, Long> mergedMap;37 * Key is the PrimitiveId in their dataset, the value is the PrimitiveId in my dataset 38 */ 39 private final Map<PrimitiveId, PrimitiveId> mergedMap; 40 40 /** a set of primitive ids for which we have to fix references (to nodes and 41 41 * to relation members) after the first phase of merging … … 58 58 this.sourceDataSet = sourceDataSet; 59 59 conflicts = new ConflictCollection(); 60 mergedMap = new HashMap< Long, Long>();60 mergedMap = new HashMap<PrimitiveId, PrimitiveId>(); 61 61 objectsWithChildrenToMerge = new HashSet<PrimitiveId>(); 62 62 deletedObjectsToUnlink = new HashSet<OsmPrimitive>(); … … 106 106 } 107 107 if (target.hasEqualSemanticAttributes(source)) { 108 mergedMap.put(source.get UniqueId(), target.getUniqueId());108 mergedMap.put(source.getPrimitiveId(), target.getPrimitiveId()); 109 109 // copy the technical attributes from other 110 110 // version … … 131 131 target.mergeFrom(source); 132 132 targetDataSet.addPrimitive(target); 133 mergedMap.put(source.get UniqueId(), target.getUniqueId());133 mergedMap.put(source.getPrimitiveId(), target.getPrimitiveId()); 134 134 objectsWithChildrenToMerge.add(source.getPrimitiveId()); 135 135 } 136 136 137 137 protected OsmPrimitive getMergeTarget(OsmPrimitive mergeSource) throws IllegalStateException{ 138 Long targetId = mergedMap.get(mergeSource.getUniqueId());138 PrimitiveId targetId = mergedMap.get(mergeSource.getPrimitiveId()); 139 139 if (targetId == null) 140 140 return null; 141 return targetDataSet.getPrimitiveById(targetId , mergeSource.getType());141 return targetDataSet.getPrimitiveById(targetId); 142 142 } 143 143 … … 278 278 return false; 279 279 // found a corresponding target, remember it 280 mergedMap.put(source.get UniqueId(), target.getUniqueId());280 mergedMap.put(source.getPrimitiveId(), target.getPrimitiveId()); 281 281 282 282 if (target.getVersion() > source.getVersion())
Note:
See TracChangeset
for help on using the changeset viewer.