Changeset 19034 in josm for trunk/src


Ignore:
Timestamp:
2024-04-06T10:03:50+02:00 (10 months ago)
Author:
GerdP
Message:

fix #9304: fix #9304: in validator, check for intersecting roads in different layers

  • exclude highway areas with layer != 0 from test
  • add one more test case with a bridge that is split (code coverage)
File:
1 edited

Legend:

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

    r19029 r19034  
    311311    private void testDifferentLayers(Node connection) {
    312312        List<Way> ways = connection.getParentWays();
    313         ways.removeIf(w -> !w.hasTag("highway") || w.hasTag("highway", "steps"));
     313        ways.removeIf(w -> !w.hasTag("highway") || w.hasTag("highway", "steps") || isSpecialArea(w));
    314314        if (ways.size() < 2 || ways.stream().noneMatch(w -> w.hasKey("layer")))
    315315            return;
     
    339339
    340340    /**
     341     * Check if way is an area on a layer above or below 0.
     342     * @param w the way
     343     * @return true if way is an area on a layer above or below 0
     344     */
     345    private static boolean isSpecialArea(Way w) {
     346        return w.hasAreaTags() && OsmUtils.getLayer(w) != null;
     347    }
     348
     349    /**
    341350     * Check if there are at least two neighbouring nodes on the given ways.
    342351     * If so, the connection node can be considered to be at a specific layer, else it marks the end of such a layer
Note: See TracChangeset for help on using the changeset viewer.