Changeset 6862 in josm for trunk/src


Ignore:
Timestamp:
2014-02-17T19:42:07+01:00 (6 years ago)
Author:
simon04
Message:

see #9598 - Validator: report "Overlapping ways" only if at least 3 segments are shared

Location:
trunk/src/org/openstreetmap/josm/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java

    r6619 r6862  
    9494    @Override
    9595    public String toString() {
    96         return "WaySegment [way=" + way.getId() + ", lowerIndex=" + lowerIndex + "]";
     96        return "WaySegment [way=" + way.getUniqueId() + ", lowerIndex=" + lowerIndex + "]";
    9797    }
    9898}
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java

    r6722 r6862  
    7474        Map<List<Way>, Set<WaySegment>> seenWays = new HashMap<List<Way>, Set<WaySegment>>(500);
    7575
     76        Collection<TestError> preliminaryErrors = new ArrayList<TestError>();
    7677        for (Set<WaySegment> duplicated : nodePairs.values()) {
    7778            int ways = duplicated.size();
     
    137138                    }
    138139
    139                     errors.add(new TestError(this,
     140                    preliminaryErrors.add(new TestError(this,
    140141                            type < OVERLAPPING_HIGHWAY_AREA ? Severity.WARNING : Severity.OTHER,
    141142                                    errortype, type, prims, duplicated));
     
    148149            }
    149150        }
     151
     152        // see ticket #9598 - only report if at least 3 segments are shared
     153        for (TestError error : preliminaryErrors) {
     154            if (error.getHighlighted().size() / error.getPrimitives().size() >= 3) {
     155                errors.add(error);
     156            }
     157        }
     158
    150159        super.endTest();
    151160        nodePairs = null;
Note: See TracChangeset for help on using the changeset viewer.