Changeset 7309 in josm


Ignore:
Timestamp:
2014-07-12T20:45:45+02:00 (6 years ago)
Author:
akks
Message:

fix #10256: incorrect "Highway link is not linked" warning for closed ways

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/Highways.java

    r7273 r7309  
    151151
    152152        final HashSet<OsmPrimitive> referrers = new HashSet<>();
    153         referrers.addAll(way.firstNode().getReferrers());
    154         referrers.addAll(way.lastNode().getReferrers());
     153       
     154        if (way.isClosed()) {
     155            // for closed way we need to check all adjacent ways
     156            for (Node n: way.getNodes()) {
     157                referrers.addAll(n.getReferrers());
     158            }
     159        } else {
     160            referrers.addAll(way.firstNode().getReferrers());
     161            referrers.addAll(way.lastNode().getReferrers());
     162        }
    155163
    156164        return Utils.exists(Utils.filteredCollection(referrers, Way.class), new Predicate<Way>() {
Note: See TracChangeset for help on using the changeset viewer.