Changeset 3596 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-10-09T07:57:01+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r3530 r3596 26 26 import org.openstreetmap.josm.command.DeleteCommand; 27 27 import org.openstreetmap.josm.command.SequenceCommand; 28 import org.openstreetmap.josm.data.coor.LatLon; 28 29 import org.openstreetmap.josm.data.osm.Node; 29 30 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 88 89 */ 89 90 public static Node selectTargetLocationNode(LinkedHashSet<Node> candidates) { 90 Node targetNode = null; 91 for (Node n : candidates) { // pick last one 92 targetNode = n; 93 } 94 return targetNode; 91 if (! Main.pref.getBoolean("merge-nodes.average-location", false)) { 92 Node targetNode = null; 93 for (final Node n : candidates) { // pick last one 94 targetNode = n; 95 } 96 return targetNode; 97 } 98 99 double lat = 0, lon = 0; 100 for (final Node n : candidates) { 101 lat += n.getCoor().lat(); 102 lon += n.getCoor().lon(); 103 } 104 105 return new Node(new LatLon(lat / candidates.size(), lon / candidates.size())); 95 106 } 96 107
Note:
See TracChangeset
for help on using the changeset viewer.