Changeset 17413 in josm


Ignore:
Timestamp:
2020-12-17T09:43:16+01:00 (5 weeks ago)
Author:
GerdP
Message:

see #20019: Warn about direction=forward/backward on invalid nodes.

  • revert changes in DirectionNodes.java from 17412
  • improve test coverage (nodes with positive ids)
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/nodist/data/direction-nodes.osm

    r17412 r17413  
    11<?xml version='1.0' encoding='UTF-8'?>
    22<osm version='0.6' upload='never' generator='JOSM'>
     3  <bounds minlat='53.2707779' minlon='10.4797161' maxlat='53.2820304' maxlon='10.5029633' origin='JOSM' />
    34  <node id='-144644' action='modify' lat='53.27687963931' lon='10.48026196529' />
    45  <node id='-144645' action='modify' lat='53.27753227122' lon='10.48343889291' />
     
    255256    <tag k='railway:signal:minor:form' v='sign' />
    256257    <tag k='railway:signal:position' v='in_track' />
     258  </node>
     259  <node id='111' version='1' lat='53.2769797' lon='10.5045821'>
     260    <tag k='direction' v='forward' />
     261    <tag k='josm_error_codes' v='none' />
     262    <tag k='name' v='Oldtown' />
     263    <tag k='traffic_sign' v='city_limit' />
     264  </node>
     265  <node id='112' version='1' lat='53.2752042' lon='10.5009577'>
     266    <tag k='direction' v='forward' />
     267    <tag k='josm_error_codes' v='4002' />
     268    <tag k='name' v='Oldtown 2' />
     269    <tag k='traffic_sign' v='city_limit' />
    257270  </node>
    258271  <way id='-102854' action='modify'>
  • trunk/src/org/openstreetmap/josm/data/validation/tests/DirectionNodes.java

    r17412 r17413  
    9292                        marktr("Node with {0} on end of way"), tag);
    9393            }
    94         } else { // ways.size() > 1
     94        } else if (ways.size() > 1) {
    9595            builder = TestError.builder(this, Severity.OTHER, MULTIPLE_WAYS_CODE).message(DISPUTED_USE_MSG,
    9696                    marktr("Node with {0} on a connection of multiple ways"), tag);
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/DirectionNodesTest.java

    r17411 r17413  
    22package org.openstreetmap.josm.data.validation.tests;
    33
    4 import java.util.stream.Collectors;
    5 
    64import org.junit.jupiter.api.Test;
    75import org.junit.jupiter.api.extension.RegisterExtension;
    8 import org.openstreetmap.josm.data.osm.OsmPrimitive;
    96import org.openstreetmap.josm.testutils.JOSMTestRules;
    107
     
    2926     */
    3027    @Test
    31     void testMultipolygonFile() throws Exception {
     28    void testDirectionsNodesTestFile() throws Exception {
    3229        final DirectionNodes test = new DirectionNodes();
    33         ValidatorTestUtils.testSampleFile("nodist/data/direction-nodes.osm",
    34                 ds -> ds.getNodes().stream().filter(OsmPrimitive::hasKeys).collect(Collectors.toList()),
    35         null, test);
    36 
     30        ValidatorTestUtils.testSampleFile("nodist/data/direction-nodes.osm", ds -> ds.getNodes(), null, test);
    3731    }
    38 
    3932}
Note: See TracChangeset for help on using the changeset viewer.