Ticket #20680: 20680.patch
File 20680.patch, 2.1 KB (added by , 4 years ago) |
---|
-
src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
15 15 import java.util.stream.Collectors; 16 16 17 17 import org.openstreetmap.josm.data.coor.EastNorth; 18 import org.openstreetmap.josm.data.osm.DataSet; 19 import org.openstreetmap.josm.data.osm.OsmDataManager; 18 20 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 21 import org.openstreetmap.josm.data.osm.OsmUtils; 20 22 import org.openstreetmap.josm.data.osm.Relation; … … 80 82 private final Map<Point2D, List<WaySegment>> cellSegments = new HashMap<>(1000); 81 83 /** The already detected ways in error */ 82 84 private final Map<List<Way>, List<WaySegment>> seenWays = new HashMap<>(50); 85 protected boolean isSurroundingTest; 83 86 84 87 protected final int code; 85 88 … … 298 301 @Override 299 302 public void startTest(ProgressMonitor monitor) { 300 303 super.startTest(monitor); 304 isSurroundingTest = false; 301 305 cellSegments.clear(); 302 306 seenWays.clear(); 303 307 } … … 304 308 305 309 @Override 306 310 public void endTest() { 311 // see #20680: if only a selection was tested, test it also against the other suitable ways 312 if (partialSelection && !cellSegments.isEmpty() && !(this instanceof SelfCrossing)) { 313 isSurroundingTest = true; // don't add more ways to the spatial index 314 DataSet ds = OsmDataManager.getInstance().getActiveDataSet(); 315 for (Way w : ds.getWays()) { 316 if (isPrimitiveUsable(w)) 317 visit(w); 318 } 319 } 307 320 super.endTest(); 308 321 cellSegments.clear(); 309 322 seenWays.clear(); … … 390 403 highlight.add(es2); 391 404 } 392 405 } 393 segments.add(es1); 406 if (!isSurroundingTest) 407 segments.add(es1); 394 408 } 395 409 } 396 410 }