Changeset 14494 in josm


Ignore:
Timestamp:
2018-12-02T17:00:07+01:00 (5 months ago)
Author:
GerdP
Message:

fix #17057

  • Allow multiple from ways in no_entry turn restriction
  • Allow multiple to ways in no_exit turn restriction
  • Don't check turn restrictions in RelationChecker when TurnrestrictionTest is enabled
Location:
trunk/src/org/openstreetmap/josm/data/validation/tests
Files:
2 edited

Legend:

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

    r14437 r14494  
    6464    public static final String ROLE_VERIF_PROBLEM_MSG = tr("Role verification problem");
    6565    private boolean ignoreMultiPolygons;
     66    private boolean ignoreTurnRestrictions;
    6667
    6768    /**
     
    109110            if (t instanceof MultipolygonTest) {
    110111                ignoreMultiPolygons = true;
    111                 break;
     112            }
     113            if (t instanceof TurnrestrictionTest) {
     114                ignoreTurnRestrictions = true;
    112115            }
    113116        }
     
    125128        if (ignoreMultiPolygons && n.isMultipolygon()) {
    126129            // see #17010: don't report same problem twice
     130            return;
     131        }
     132        if (ignoreTurnRestrictions && n.hasTag("type","restriction")) {
     133            // see #17057: TurnrestrictionTest is specialized on this
    127134            return;
    128135        }
  • trunk/src/org/openstreetmap/josm/data/validation/tests/TurnrestrictionTest.java

    r11608 r14494  
    130130            }
    131131        }
     132        final String restriction = r.get("restriction");
    132133        if (morefrom) {
    133             errors.add(TestError.builder(this, Severity.ERROR, MORE_FROM)
     134            Severity severity = "no_entry".equals(restriction) ? Severity.OTHER : Severity.ERROR;
     135            errors.add(TestError.builder(this, severity, MORE_FROM)
    134136                    .message(tr("More than one \"from\" way found"))
    135137                    .primitives(r)
     
    137139        }
    138140        if (moreto) {
    139             errors.add(TestError.builder(this, Severity.ERROR, MORE_TO)
     141            Severity severity = "no_exit".equals(restriction) ? Severity.OTHER : Severity.ERROR;
     142            errors.add(TestError.builder(this, severity, MORE_TO)
    140143                    .message(tr("More than one \"to\" way found"))
    141144                    .primitives(r)
     
    170173        }
    171174        if (fromWay.equals(toWay)) {
    172             Severity severity = r.hasTag("restriction", "no_u_turn") ? Severity.OTHER : Severity.WARNING;
     175            Severity severity = "no_u_turn".equals(restriction) ? Severity.OTHER : Severity.WARNING;
    173176            errors.add(TestError.builder(this, severity, FROM_EQUALS_TO)
    174177                    .message(tr("\"from\" way equals \"to\" way"))
Note: See TracChangeset for help on using the changeset viewer.