Changeset 15961 in josm


Ignore:
Timestamp:
2020-02-29T10:29:58+01:00 (8 months ago)
Author:
GerdP
Message:

fix #16707: Warn about overlapping connected buildings

  • add rule in geometry.mapcss to check overlapping buildings
  • change rule which checks overlapping identical landuses to also check landuse=residential
  • disable the corresponding tests in CrossingWays

effects for the user:

  • Message "Crossing buildings" is replaced by "Overlapping buildings"
  • Message "Crossing residential areas" is replaced by generic "Overlapping Identical Landuses"
  • different highlighting of the overlapping area
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/validator/geometry.mapcss

    r15941 r15961  
    167167}
    168168
     169/* Building overlapping building (spatial test) */
     170area[building][building!~/no|entrance/] ⧉ area[building][building!~/no|entrance/] {
     171  throwWarning: tr("Overlapping buildings");
     172}
     173
    169174/* Overlapping areas (spatial test) */
    170175area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
     
    193198}
    194199
    195 area:closed:areaStyle[landuse!=residential][tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse][landuse!=residential] {
     200area:closed:areaStyle[tag("landuse") = parent_tag("landuse")] ⧉ area:closed:areaStyle[landuse] {
    196201  throwWarning: tr("Overlapping Identical Landuses");
    197202}
  • trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java

    r15959 r15961  
    116116                return true;
    117117            }
     118            if (isBuilding(w1) && isBuilding(w2))
     119                return true;
    118120            if (w1.hasKey(HIGHWAY) && w2.hasKey(HIGHWAY) && !Objects.equals(w1.get("level"), w2.get("level"))) {
    119121                return true;
    120122            }
    121             if ((w1.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY) && isResidentialArea(w2))
    122              || (w2.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY) && isResidentialArea(w1)))
     123            if (((isResidentialArea(w1) || w1.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY)) && isResidentialArea(w2))
     124             || ((isResidentialArea(w2) || w2.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY)) && isResidentialArea(w1)))
    123125                return true;
    124126            if (isSubwayOrTramOrRazed(w2)) {
     
    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);
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/CrossingWaysTest.java

    r15704 r15961  
    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");
     
    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");
Note: See TracChangeset for help on using the changeset viewer.