Changeset 17023 in josm


Ignore:
Timestamp:
2020-09-12T21:00:17+02:00 (9 days ago)
Author:
stoecker
Message:

fix #19714, patch by gaben, don't complain about direction reversal in case of two_sided=yes

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrector.java

    r16939 r17023  
    5858            if (isDirectional) {
    5959                final boolean cannotBeCorrected = ReverseWayTagCorrector.getTagCorrections(tag).isEmpty();
    60                 if (cannotBeCorrected) {
     60
     61                if (cannotBeCorrected && !way.isKeyTrue("two_sided")) {
     62                    // two_sided=yes is a special (documented) barrier=city_wall attribute, see #197140
    6163                    collection.add(tag);
    6264                }
  • trunk/test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrectorTest.java

    r14256 r17023  
    77import org.junit.Test;
    88import org.openstreetmap.josm.data.osm.Tag;
     9import org.openstreetmap.josm.data.osm.Tagged;
     10import org.openstreetmap.josm.data.osm.Way;
    911import org.openstreetmap.josm.testutils.JOSMTestRules;
    1012
     
    3436        assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("incline", "up")).size());
    3537        assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("oneway", "yes")).size());
     38        assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("barrier", "kerb")).size());
     39        assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("barrier", "city_wall")).size());
     40
     41        final Tagged twoSidedCityWall = new Way();
     42        twoSidedCityWall.put("barrier", "city_wall");
     43        twoSidedCityWall.put("two_sided", "yes");
     44        assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(twoSidedCityWall).size());
    3645    }
    3746}
Note: See TracChangeset for help on using the changeset viewer.