Changeset 2202 in josm for trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
- Timestamp:
- 2009-09-27T18:01:21+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r2181 r2202 25 25 import org.openstreetmap.josm.data.osm.Tag; 26 26 import org.openstreetmap.josm.data.osm.TagCollection; 27 import org.openstreetmap.josm.data.osm.TigerUtils; 27 28 import org.openstreetmap.josm.data.osm.Way; 28 29 import org.openstreetmap.josm.data.osm.BackreferencedDataSet.RelationToChildReference; … … 93 94 94 95 /** 96 * Combines tags from TIGER data 97 * 98 * @param tc the tag collection 99 */ 100 protected static void combineTigerTags(TagCollection tc) { 101 for (String key: tc.getKeys()) { 102 if (TigerUtils.isTigerTag(key)) { 103 tc.setUniqueForKey(key, TigerUtils.combineTags(key, tc.getValues(key))); 104 } 105 } 106 } 107 108 /** 95 109 * Selects a node out of a collection of candidate nodes. The selected 96 110 * node will become the target node the remaining nodes are merged to. … … 153 167 * Fixes the parent ways referring to one of the nodes. 154 168 * 155 * Replies null, if the ways could not be fixed, i.e. because a way would have to be delted 169 * Replies null, if the ways could not be fixed, i.e. because a way would have to be deleted 156 170 * which is referred to by a relation. 157 171 * … … 159 173 * @param nodesToDelete the collection of nodes to be deleted 160 174 * @param targetNode the target node the other nodes are merged to 161 * @return a list of command ; null,the ways could not be fixed175 * @return a list of commands; null, if the ways could not be fixed 162 176 */ 163 177 protected static List<Command> fixParentWays(BackreferencedDataSet backreferences, Collection<OsmPrimitive> nodesToDelete, Node targetNode) { … … 207 221 /** 208 222 * Merges the nodes in <code>node</code> onto one of the nodes. Uses the dataset 209 * managed by <code>layer</code> as reference. <code>backreferences</code> is precomputed 223 * managed by <code>layer</code> as reference. <code>backreferences</code> is a precomputed 210 224 * collection of all parent/child references in the dataset. 211 225 * 212 226 * @param layer layer the reference data layer. Must not be null. 213 * @param backreferences if null, backrefer neces are first computed from layer.data; otherwise214 * backreferences.getSource() == layer.data must hold227 * @param backreferences if null, backreferences are first computed from layer.data; otherwise 228 * backreferences.getSource() == layer.data must be true 215 229 * @param nodes the collection of nodes. Ignored if null. 216 230 * @param targetNode the target node the collection of nodes is merged to. Must not be null. … … 235 249 // 236 250 TagCollection nodeTags = TagCollection.unionOfAllPrimitives(nodes); 251 combineTigerTags(nodeTags); 237 252 completeTagCollectionWithMissingTags(nodeTags, nodes); 238 253 TagCollection nodeTagsToEdit = new TagCollection(nodeTags); … … 258 273 nodesToDelete.remove(targetNode); 259 274 260 // changethe ways referring to at least one of the merge nodes275 // fix the ways referring to at least one of the merged nodes 261 276 // 262 277 Collection<Way> waysToDelete= new HashSet<Way>(); … … 287 302 288 303 /** 289 * Enable the "Merge Nodes" menu option if more th en one node is selected304 * Enable the "Merge Nodes" menu option if more than one node is selected 290 305 */ 291 306 @Override
Note:
See TracChangeset
for help on using the changeset viewer.
