Ticket #13347: simplify_CrossingWays.patch
| File simplify_CrossingWays.patch, 2.3 KB (added by , 9 years ago) |
|---|
-
src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
7 7 import java.util.ArrayList; 8 8 import java.util.Arrays; 9 9 import java.util.HashMap; 10 import java.util.HashSet;11 10 import java.util.List; 12 11 import java.util.Map; 13 12 import java.util.Objects; 14 import java.util.Set;15 13 16 14 import org.openstreetmap.josm.Main; 17 15 import org.openstreetmap.josm.data.coor.EastNorth; … … 40 38 41 39 /** All way segments, grouped by cells */ 42 40 private final Map<Point2D, List<WaySegment>> cellSegments = new HashMap<>(1000); 43 /** The already detected errors */44 private final Set<WaySegment> errorSegments = new HashSet<>();45 41 /** The already detected ways in error */ 46 42 private final Map<List<Way>, List<WaySegment>> seenWays = new HashMap<>(50); 47 43 … … 188 184 public void startTest(ProgressMonitor monitor) { 189 185 super.startTest(monitor); 190 186 cellSegments.clear(); 191 errorSegments.clear();192 187 seenWays.clear(); 193 188 } 194 189 … … 196 191 public void endTest() { 197 192 super.endTest(); 198 193 cellSegments.clear(); 199 errorSegments.clear();200 194 seenWays.clear(); 201 195 } 202 196 … … 241 235 List<Way> prims; 242 236 List<WaySegment> highlight; 243 237 244 if ((errorSegments.contains(es1) && errorSegments.contains(es2)) 245 || !es1.intersects(es2) 246 || ignoreWaySegmentCombination(es1.way, es2.way)) { 238 if (!es1.intersects(es2) || ignoreWaySegmentCombination(es1.way, es2.way)) { 247 239 continue; 248 240 } 249 241 … … 278 270 * @param n2 The second EastNorth 279 271 * @return A list with all the cells the segment crosses 280 272 */ 281 p ublicList<List<WaySegment>> getSegments(EastNorth n1, EastNorth n2) {273 private List<List<WaySegment>> getSegments(EastNorth n1, EastNorth n2) { 282 274 283 275 List<List<WaySegment>> cells = new ArrayList<>(); 284 276 for (Point2D cell : ValUtil.getSegmentCells(n1, n2, OsmValidator.griddetail)) {
