Ticket #16707: 16707.2.patch

File 16707.2.patch, 4.3 KB (added by GerdP, 9 months ago)
  • data/validator/geometry.mapcss

     
    166166  throwWarning: tr("Building inside building");
    167167}
    168168
     169/* Building overlapping building (spatial test) */
     170area[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")] ⧉
     171area[building][building!~/no|entrance/] {
     172  throwWarning: tr("Overlapping buildings");
     173}
     174
    169175/* Overlapping areas (spatial test) */
    170176area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
    171177  set water_area;
     
    192198  throwWarning: tr("Overlapping Identical Natural Areas");
    193199}
    194200
    195 area:closed:areaStyle[landuse!=residential][tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse][landuse!=residential] {
     201area:closed:areaStyle[tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse] {
    196202  throwWarning: tr("Overlapping Identical Landuses");
    197203}
    198204
  • src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java

     
    118118            if (w1.hasKey(HIGHWAY) && w2.hasKey(HIGHWAY) && !Objects.equals(w1.get("level"), w2.get("level"))) {
    119119                return true;
    120120            }
    121             if ((w1.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY) && isResidentialArea(w2))
    122              || (w2.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY) && isResidentialArea(w1)))
     121            if (isBuilding(w1) && isBuilding(w2))
    123122                return true;
     123            if (((isResidentialArea(w1) || w1.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY)) && isResidentialArea(w2))
     124             || ((isResidentialArea(w2) || w2.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY)) && isResidentialArea(w1)))
     125                return true;
    124126            if (isSubwayOrTramOrRazed(w2)) {
    125127                return true;
    126128            }
     
    141143
    142144            if (types[0] == types[1]) {
    143145                switch (types[0]) {
     146                // 610 and 640 where removed for #16707
    144147                case BARRIER:
    145148                    return new MessageHelper(tr("Crossing barriers"), 603);
    146                 case BUILDING:
    147                     return new MessageHelper(tr("Crossing buildings"), 610);
    148149                case HIGHWAY:
    149150                    return new MessageHelper(tr("Crossing highways"), 620);
    150151                case RAILWAY:
    151152                    return new MessageHelper(tr("Crossing railways"), 630);
    152                 case RESIDENTIAL_AREA:
    153                     return new MessageHelper(tr("Crossing residential areas"), 640);
    154153                case WATERWAY:
    155154                    return new MessageHelper(tr("Crossing waterways"), 650);
    156155                case WAY:
  • test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java

     
    125125        assertTrue(test.isPrimitiveUsable(newUsableWay("landuse=residential")));
    126126        // createMessage
    127127        testMessage(601, test, "amenity=restaurant", "amenity=restaurant");
    128         testMessage(610, test, "building=yes", "building=yes");
    129128        testMessage(611, test, "building=yes", "amenity=restaurant");
    130129        testMessage(612, test, "building=yes", "highway=road");
    131130        testMessage(613, test, "building=yes", "railway=rail");
     
    138137        testMessage(630, test, "railway=rail", "railway=rail");
    139138        testMessage(631, test, "railway=rail", "amenity=restaurant");
    140139        testMessage(632, test, "railway=rail", "waterway=river");
    141         testMessage(640, test, "landuse=residential", "landuse=residential");
    142140        testMessage(641, test, "landuse=residential", "amenity=restaurant");
    143141        testMessage(650, test, "waterway=river", "waterway=river");
    144142        testMessage(651, test, "waterway=river", "amenity=restaurant");