Changeset 24846 in osm for applications/editors/josm/plugins/simplifyarea/src
- Timestamp:
- 2010-12-23T12:21:34+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java
r23489 r24846 225 225 LatLon coord2 = null; 226 226 227 for (int i = 0, len = size2 + 1 + (closed ? 1 : 0); i < len; i++) {228 final Node n = newNodes.get( i % size2);227 for (int i = 0, j = 0, len = size2 + (closed ? 2 : 1); i < len; i++, j++) { 228 final Node n = newNodes.get(j % newNodes.size()); 229 229 final LatLon coord3 = n.getCoor(); 230 230 231 231 if (coord1 != null) { 232 System.out.print("AREA: " + computeArea(coord1, coord2, coord3) + "; ANGLE: " + computeConvectAngle(coord1, coord2, coord3) + "; XTE: " + crossTrackError(coord1, coord2, coord3)); 232 // System.out.print("AREA: " + computeArea(coord1, coord2, coord3) + "; ANGLE: " + computeConvectAngle(coord1, coord2, coord3) + "; XTE: " + crossTrackError(coord1, coord2, coord3)); 233 234 // final double weight = isRequiredNode(w, prevNode) || !closed && i == len - 1 ? Double.MAX_VALUE : 235 // computeConvectAngle(coord1, coord2, coord3) / angleThreshold + 236 // computeArea(coord1, coord2, coord3) / areaThreshold + 237 // Math.abs(crossTrackError(coord1, coord2, coord3)) / distanceThreshold; 238 233 239 if (isRequiredNode(w, prevNode) || 234 240 !closed && i == len - 1 || // don't remove last node of the not closed way 235 241 computeConvectAngle(coord1, coord2, coord3) > angleThreshold || 236 242 computeArea(coord1, coord2, coord3) > areaThreshold || 237 243 Math.abs(crossTrackError(coord1, coord2, coord3)) > distanceThreshold) { 238 244 newNodes2.add(prevNode); 239 System.out.println(" ... KEEP");245 // System.out.println(" ... KEEP " + prevNode.getUniqueId()); 240 246 } else { 241 System.out.println(" ... REMOVE");247 // System.out.println(" ... REMOVE " + prevNode.getUniqueId()); 242 248 coord2 = coord1; // at the end of the iteration preserve coord1 249 newNodes.remove(prevNode); 250 j--; 243 251 } 244 252 } else if (!closed && prevNode != null) {
Note:
See TracChangeset
for help on using the changeset viewer.