Ticket #20352: 20352.2.patch

File 20352.2.patch, 1.6 KB (added by GerdP, 7 weeks ago)

also distinguish water areas (lakes, ponds etc) from river areas

  • src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java

     
    128128            if (w1.hasKey(RAILWAY) && w2.hasKey(RAILWAY) && w1.hasTag(RAILWAY, "yard") != w2.hasTag(RAILWAY, "yard")) {
    129129                return true; // see #20089
    130130            }
    131             return (w1.hasTag(WATERWAY, "river", "stream", "canal", "drain", "ditch") && w2.hasTag(WATERWAY, "riverbank"))
    132                     || (w2.hasTag(WATERWAY, "river", "stream", "canal", "drain", "ditch") && w1.hasTag(WATERWAY, "riverbank"));
     131            return (w1.hasTag(WATERWAY, "river", "stream", "canal", "drain", "ditch") && isRiverArea(w2))
     132                    || (w2.hasTag(WATERWAY, "river", "stream", "canal", "drain", "ditch") && isRiverArea(w1));
    133133        }
    134134
    135135        @Override
     
    314314    }
    315315
    316316    static boolean isWaterArea(OsmPrimitive w) {
    317         return w.hasTag("natural", "water") || w.hasTag(LANDUSE, "reservoir");
     317        return w.hasTag("natural", "water") || w.hasTag("waterway", "riverbank") || w.hasTag(LANDUSE, "reservoir");
    318318    }
    319319
     320    static boolean isRiverArea(OsmPrimitive w) {
     321        return w.hasTag("waterway", "riverbank")
     322                || (w.hasTag("natural", "water") && w.hasTag("water", "river", "stream", "canal", "drain", "ditch"));
     323    }
     324
    320325    static boolean isHighway(OsmPrimitive w) {
    321326        return w.hasTagDifferent(HIGHWAY, "rest_area", "services", "bus_stop", "platform");
    322327    }