Changeset 27973 in osm
- Timestamp:
- 2012-03-02T16:45:35+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/dumbutils/ReplaceGeometryAction.java
r27972 r27973 85 85 } 86 86 } 87 88 /** 89 * Replace subjectObject geometry with referenceObject geometry and merge tags 90 * and relation memberships. 91 * 92 * @param subjectObject 93 * @param referenceSubject 94 * @return 95 */ 96 public boolean replace(OsmPrimitive subjectObject, OsmPrimitive referenceSubject) { 97 if (subjectObject instanceof Node && referenceSubject instanceof Node) { 98 return replaceNode((Node) subjectObject, (Node) referenceSubject); 99 } else if (subjectObject instanceof Way && referenceSubject instanceof Way) { 100 return replaceWay((Way) subjectObject, (Way) referenceSubject); 101 } else if (subjectObject instanceof Node) { 102 return upgradeNode((Node) subjectObject, referenceSubject); 103 } else if (referenceSubject instanceof Node) { 104 // TODO: fix this illogical reversal? 105 return upgradeNode((Node) referenceSubject, subjectObject); 106 } else { 107 throw new IllegalArgumentException(tr("This tool can only replace a node, upgrade a node to a way or a multipolygon, or replace a way with a way.")); 108 } 109 } 87 110 88 111 /** … … 242 265 return false; 243 266 } 244 return replaceWay WithWay(subjectWay, referenceWay);245 } 246 247 public static boolean replaceWay WithWay(Way subjectWay, Way referenceWay) {267 return replaceWay(subjectWay, referenceWay); 268 } 269 270 public static boolean replaceWay(Way subjectWay, Way referenceWay) { 248 271 249 272 Area a = getCurrentDataSet().getDataSourceArea();
Note:
See TracChangeset
for help on using the changeset viewer.