Changeset 13540 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2018-03-18T15:22:47+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r13434 r13540 141 141 */ 142 142 protected static boolean isRequiredNode(Way way, Node node) { 143 int frequency = Collections.frequency(way.getNodes(), node); 144 if ((way.getNode(0) == node) && (way.getNode(way.getNodesCount()-1) == node)) { 145 frequency = frequency - 1; // closed way closing node counted only once 146 } 147 boolean isRequired = frequency > 1; 143 boolean isRequired = node.isTagged(); 144 if (!isRequired) { 145 int frequency = Collections.frequency(way.getNodes(), node); 146 if ((way.getNode(0) == node) && (way.getNode(way.getNodesCount()-1) == node)) { 147 frequency = frequency - 1; // closed way closing node counted only once 148 } 149 isRequired = frequency > 1; 150 } 148 151 if (!isRequired) { 149 152 List<OsmPrimitive> parents = new LinkedList<>(); … … 151 154 parents.remove(way); 152 155 isRequired = !parents.isEmpty(); 153 }154 if (!isRequired) {155 isRequired = node.isTagged();156 156 } 157 157 return isRequired; … … 210 210 } 211 211 } 212 213 if (newNodes.size() == w.getNodesCount()) return null; 212 214 213 215 Set<Node> delNodes = new HashSet<>();
Note:
See TracChangeset
for help on using the changeset viewer.