Ticket #9819: 9819_final_v1.patch

File 9819_final_v1.patch, 4.5 KB (added by reichg, 5 years ago)

added comment for ticket number. Future exclusions can be added if complained about.

  • resources/data/validator/combinations.mapcss

     
    7575  assertMatch: "node source:addr:postcode=postman";
    7676}
    7777
     78/* #9819 stricter checking for highways crossing waterways without bridges */
     79way!:closed[highway][layer][layer!=0][!bridge][!tunnel][!covered][highway!~/steps|elevator/],
     80way!:closed[railway][layer][layer!=0][!bridge][!tunnel][!covered],
     81way!:closed[waterway][layer][layer!=0][!bridge][!tunnel][!covered] {
     82  throwWarning: tr("inspect to confirm a {1} tag is necessary on this {0}. If so, add either {2}, {3}, {4} or any other tags complimentary to {5}", "{2.key}", "{3.key}", "{4.key}=*", "{5.key}=*", "{6.key}=*", "{3.key}=*");
     83  group: tr("suspicious tag combination");
     84  assertMatch: "way highway=tertiary layer=2";
     85  assertMatch: "way waterway=stream layer=-1";
     86  assertMatch: "way railway=rail layer=2";
     87  assertNoMatch: "way highway=tertiary layer=2 bridge=yes";
     88  assertNoMatch: "way waterway=stream layer=-1 tunnel=yes";
     89  assertNoMatch: "way railway=rail layer=2 bridge=yes";
     90}
     91
    7892/* {0.key} without {1.key} (info level) */
    7993way[lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1],
    8094way[lanes:backward][!lanes:forward][oneway!=yes][oneway!=-1],
     
    573587  throwWarning: tr("{0} on a relation without {1}", "{0.key}", "{1.tag}");
    574588}
    575589
    576 /* #9182 */
    577 way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) > 400] {
    578   throwWarning: tr("Long waterway with {0} but without a tag which defines it as tunnel or underground. Remove {1} or add a tunnel tag if applicable. Also check crossing bridges and their {1} tags.", "{1.tag}", "{1.key}");
    579   group: tr("suspicious tag combination");
    580 }
    581 way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) <= 400] {
    582   throwOther: tr("Short waterway with {0} but without a tag which defines it as tunnel or underground. Remove {1} or add a tunnel tag if applicable. Also check crossing bridges and their {1} tags.", "{1.tag}", "{1.key}");
    583   group: tr("suspicious tag combination");
    584 }
    585 
    586590/* #13144, #15536 */
    587591*[unisex=yes][female=yes][male!=yes][shop=hairdresser],
    588592*[unisex=yes][male=yes][female!=yes][shop=hairdresser] {
  • src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java

     
    114114        boolean ignoreWaySegmentCombination(Way w1, Way w2) {
    115115            if (w1 == w2)
    116116                return true;
    117             if (areLayerOrLevelDifferent(w1, w2))
    118                 return true;
    119117            if (isBuilding(w1) && isBuilding(w2))
    120118                return true; // handled by mapcss tests
    121119            if (((isResidentialArea(w1) || w1.hasKey(BARRIER, HIGHWAY, RAILWAY, WATERWAY) || isWaterArea(w1))
     
    378376                        highlight.add(es1);
    379377                        highlight.add(es2);
    380378
    381                         final MessageHelper message = createMessage(es1.getWay(), es2.getWay());
    382                         errors.add(TestError.builder(this, Severity.WARNING, message.code)
    383                                 .message(message.message)
    384                                 .primitives(prims)
    385                                 .highlightWaySegments(highlight)
    386                                 .build());
    387                         seenWays.put(prims, highlight);
     379                        if (!areLayerOrLevelDifferent(es1.getWay(), es2.getWay()))
     380                        {
     381                            final MessageHelper message = createMessage(es1.getWay(), es2.getWay());
     382                            errors.add(TestError.builder(this, Severity.WARNING, message.code)
     383                                    .message(message.message)
     384                                    .primitives(prims)
     385                                    .highlightWaySegments(highlight)
     386                                    .build());
     387                            seenWays.put(prims, highlight);
     388                        }
    388389                    } else {
    389390                        highlight.add(es1);
    390391                        highlight.add(es2);