Ticket #13347: simplify_CrossingWays.patch

File simplify_CrossingWays.patch, 2.3 KB (added by GerdP, 6 years ago)
  • src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java

     
    77import java.util.ArrayList;
    88import java.util.Arrays;
    99import java.util.HashMap;
    10 import java.util.HashSet;
    1110import java.util.List;
    1211import java.util.Map;
    1312import java.util.Objects;
    14 import java.util.Set;
    1513
    1614import org.openstreetmap.josm.Main;
    1715import org.openstreetmap.josm.data.coor.EastNorth;
     
    4038
    4139    /** All way segments, grouped by cells */
    4240    private final Map<Point2D, List<WaySegment>> cellSegments = new HashMap<>(1000);
    43     /** The already detected errors */
    44     private final Set<WaySegment> errorSegments = new HashSet<>();
    4541    /** The already detected ways in error */
    4642    private final Map<List<Way>, List<WaySegment>> seenWays = new HashMap<>(50);
    4743
     
    188184    public void startTest(ProgressMonitor monitor) {
    189185        super.startTest(monitor);
    190186        cellSegments.clear();
    191         errorSegments.clear();
    192187        seenWays.clear();
    193188    }
    194189
     
    196191    public void endTest() {
    197192        super.endTest();
    198193        cellSegments.clear();
    199         errorSegments.clear();
    200194        seenWays.clear();
    201195    }
    202196
     
    241235                    List<Way> prims;
    242236                    List<WaySegment> highlight;
    243237
    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)) {
    247239                        continue;
    248240                    }
    249241
     
    278270     * @param n2 The second EastNorth
    279271     * @return A list with all the cells the segment crosses
    280272     */
    281     public List<List<WaySegment>> getSegments(EastNorth n1, EastNorth n2) {
     273    private List<List<WaySegment>> getSegments(EastNorth n1, EastNorth n2) {
    282274
    283275        List<List<WaySegment>> cells = new ArrayList<>();
    284276        for (Point2D cell : ValUtil.getSegmentCells(n1, n2, OsmValidator.griddetail)) {