Changeset 7121 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2014-05-14T09:05:56+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/FollowLineAction.java
r6142 r7121 15 15 import org.openstreetmap.josm.data.osm.Node; 16 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;18 17 import org.openstreetmap.josm.data.osm.Way; 19 18 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 20 19 import org.openstreetmap.josm.tools.Shortcut; 20 import org.openstreetmap.josm.tools.Utils; 21 21 22 22 /** … … 84 84 85 85 Node newPoint = null; 86 for (OsmPrimitive referrer : referrers) { 87 if (!referrer.getType().equals(OsmPrimitiveType.WAY)) { // Can't follow points or relations 88 continue; 89 } 90 Way toFollow = (Way) referrer; 86 for (final Way toFollow : Utils.filteredCollection(referrers, Way.class)) { 91 87 if (toFollow.equals(follower)) { 92 88 continue; 93 89 } 94 90 Set<Node> points = toFollow.getNeighbours(last); 95 if (!points.remove(prev) || points.isEmpty()) 91 points.remove(prev); 92 if (points.isEmpty()) // No candidate -> consider next way 96 93 continue; 97 94 if (points.size() > 1) // Ambiguous junction? 98 95 return; 99 96 97 // points contains exactly one element 100 98 Node newPointCandidate = points.iterator().next(); 101 99
Note:
See TracChangeset
for help on using the changeset viewer.