From 519bb980cbf60aab2660334b6da3da4c44660222 Mon Sep 17 00:00:00 2001 From: Michael Droogleever Fortuyn Date: Sun, 24 Apr 2022 10:39:47 +0200 Subject: [PATCH] Add Lane Count Tests --- data/tests.yml | 774 ++++++++++++++++++++++++------------------------- 1 file changed, 379 insertions(+), 395 deletions(-) diff --git a/data/tests.yml b/data/tests.yml index 5108cce0..7e0254fc 100644 --- a/data/tests.yml +++ b/data/tests.yml @@ -288,12 +288,10 @@ shoulder: "no" sidewalk: "no" driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + direction: forward + designated: motor_vehicle - description: sidewalk=both skip_python: true @@ -305,16 +303,14 @@ shoulder: "no" sidewalk: "both" driving_side: left - road: - highway: road - lanes: - - type: travel - designated: foot - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - designated: foot + output: + - type: travel + designated: foot + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + designated: foot - description: sidewalk=left (forward) skip_python: true @@ -326,14 +322,12 @@ shoulder: "no" sidewalk: "left" driving_side: left - road: - highway: road - lanes: - - type: travel - designated: foot - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + designated: foot + - type: travel + direction: forward + designated: motor_vehicle - description: sidewalk=right (forward) skip_python: true @@ -345,14 +339,12 @@ shoulder: "no" sidewalk: "right" driving_side: right - road: - highway: road - lanes: - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - designated: foot + output: + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + designated: foot - description: sidewalk=right (backward) skip_python: true @@ -364,14 +356,12 @@ shoulder: "no" sidewalk: "right" driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - designated: foot + output: + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + designated: foot - description: sidewalk:both=yes skip_python: true @@ -383,16 +373,14 @@ shoulder: "no" sidewalk:both: "yes" driving_side: left - road: - highway: road - lanes: - - type: travel - designated: foot - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - designated: foot + output: + - type: travel + designated: foot + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + designated: foot - description: sidewalk:left=yes skip_python: true @@ -404,14 +392,12 @@ shoulder: "no" sidewalk:left: "yes" driving_side: left - road: - highway: road - lanes: - - type: travel - designated: foot - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + designated: foot + - type: travel + direction: forward + designated: motor_vehicle - description: sidewalk:right=yes skip_python: true @@ -423,14 +409,12 @@ shoulder: "no" sidewalk:right: "yes" driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - designated: foot + output: + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + designated: foot ### Cycleways @@ -444,21 +428,19 @@ sidewalk: "no" shoulder: "no" driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: bicycle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: backward - designated: bicycle + output: + - type: travel + direction: forward + designated: bicycle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: backward + designated: bicycle - description: cycleway=lane oneway=yes skip_python: true @@ -467,22 +449,20 @@ highway: "road" lanes: "2" oneway: "yes" - cycleway:left: "lane" + cycleway:left: lane sidewalk: "no" shoulder: "no" driving_side: right - road: - highway: road - lanes: - - type: travel - direction: forward - designated: bicycle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + direction: forward + designated: bicycle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle - description: cycleway:FORWARD=lane skip_python: true @@ -490,71 +470,65 @@ tags: highway: "road" lanes: "2" - cycleway:left: "lane" + cycleway:left: lane sidewalk: "no" shoulder: "no" driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: bicycle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: backward - designated: motor_vehicle + output: + - type: travel + direction: forward + designated: bicycle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: backward + designated: motor_vehicle - description: cycleway:FORWARD=lane oneway=yes way_id: 4188078 mapillary: https://www.mapillary.com/app/?pKey=270752554744918 tags: - highway: "primary" + highway: "road" lanes: "2" - cycleway:left: "lane" + cycleway:left: lane oneway: "yes" - sidewalk: "left" + sidewalk: left driving_side: left - road: - highway: primary - lanes: - - type: travel - designated: foot - - type: travel - direction: forward - designated: bicycle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + designated: foot + - type: travel + direction: forward + designated: bicycle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle - description: cycleway:BACKWARD=lane way_id: 49207928 tags: - highway: "residential" - cycleway:right: "lane" - sidewalk: "both" + highway: "road" + cycleway:right: lane + sidewalk: both driving_side: left - road: - highway: residential - lanes: - - type: travel - designated: foot - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: backward - designated: bicycle - - type: travel - designated: foot + output: + - type: travel + designated: foot + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: backward + designated: bicycle + - type: travel + designated: foot - description: cycleway:BACKWARD=lane oneway=yes, cycleway is in the forward direction way_id: 428294122 @@ -572,29 +546,27 @@ cycleway:left: "lane" driving_side: right ISO 3166-2: US-WA - road: - highway: secondary - lanes: - - type: travel - designated: foot - - type: travel - direction: forward - designated: bicycle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - designated: foot + output: + - type: travel + designated: foot + - type: travel + direction: forward + designated: bicycle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + designated: foot - description: cycleway:FORWARD=lane cycleway:FORWARD:oneway=no way_id: 534549104 mapillary: https://www.mapillary.com/app/?pKey=1848856645291310 # TODO: find better example with same tags tags: - highway: "tertiary" + highway: "road" lanes: "2" oneway: "yes" sidewalk: "both" @@ -602,22 +574,20 @@ cycleway:right:oneway: "no" oneway:bicycle: "no" driving_side: right - road: - highway: tertiary - lanes: - - type: travel - designated: foot - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: both - designated: bicycle - - type: travel - designated: foot + output: + - type: travel + designated: foot + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: both + designated: bicycle + - type: travel + designated: foot - description: cycleway=opposite_lane oneway=yes, deprecated skip_python: true @@ -631,15 +601,13 @@ sidewalk: "no" shoulder: "no" driving_side: right - road: - highway: road - lanes: - - type: travel - direction: backward - designated: bicycle - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + direction: backward + designated: bicycle + - type: travel + direction: forward + designated: motor_vehicle - description: cycleway=opposite oneway=yes oneway:bicycle=no skip_python: true @@ -653,15 +621,13 @@ sidewalk: "no" shoulder: "no" driving_side: right - road: - highway: road - lanes: - - type: travel - direction: backward - designated: bicycle - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + direction: backward + designated: bicycle + - type: travel + direction: forward + designated: motor_vehicle ## TODO: shared cycle lanes @@ -682,21 +648,19 @@ shoulder: "no" busway: lane driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: bus - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: backward - designated: bus + output: + - type: travel + direction: forward + designated: bus + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: backward + designated: bus - description: busway:both=lane skip_kotlin: true @@ -708,21 +672,19 @@ shoulder: "no" busway:both: lane driving_side: right - road: - highway: road - lanes: - - type: travel - direction: backward - designated: bus - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: bus + output: + - type: travel + direction: backward + designated: bus + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: bus - description: busway:FORWARD=lane skip_kotlin: true @@ -734,18 +696,16 @@ shoulder: "no" busway:right: lane driving_side: right - road: - highway: road - lanes: - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: bus + output: + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: bus - description: busway:BACKWARD=lane skip_kotlin: true @@ -758,39 +718,35 @@ shoulder: "no" busway:right: lane driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: backward - designated: bus + output: + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: backward + designated: bus - description: busway=opposite_lane, deprecated skip_python: true skip_kotlin: true rust: false - tags: - highway: "road" - lanes: "2" - sidewalk: "no" - shoulder: "no" - busway: opposite_lane - driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: backward - designated: bus + tags: + highway: "road" + lanes: "2" + sidewalk: "no" + shoulder: "no" + busway: opposite_lane + driving_side: left + output: + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: backward + designated: bus ## `bus:lanes` Scheme ## https://wiki.openstreetmap.org/wiki/Bus_lanes#The_bus:lanes.3D.2A_scheme @@ -805,15 +761,13 @@ shoulder: "no" bus:lanes: "designated|" driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: bus - - type: travel - direction: backward - designated: motor_vehicle + output: + - type: travel + direction: forward + designated: bus + - type: travel + direction: backward + designated: motor_vehicle - description: psv:lanes=|yes|designated|no skip_python: true @@ -825,48 +779,46 @@ shoulder: "no" psv:lanes: "|yes|designated|no" driving_side: right - road: - highway: road - lanes: - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: forward - designated: bus - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: forward + designated: bus + - type: travel + direction: forward + designated: motor_vehicle - description: bus:lanes:forward=designated| skip_python: true skip_kotlin: true tags: highway: "road" - lanes: "3" sidewalk: "no" shoulder: "no" + lanes: "3" + lanes:forward: "2" bus:lanes:forward: "designated|" driving_side: right - road: - highway: road - lanes: - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: forward - designated: bus - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: forward + designated: bus + - type: travel + direction: forward + designated: motor_vehicle - description: bus:lanes:backward=designated skip_python: true skip_kotlin: true + rust: false # fails roundtrip (outputs busway:right=opposite_lane tag) tags: highway: "road" lanes: "2" @@ -874,15 +826,13 @@ shoulder: "no" bus:lanes:backward: "designated" driving_side: left - road: - highway: road - lanes: - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: backward - designated: bus + output: + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: backward + designated: bus ## Mixed Schemes @@ -902,37 +852,35 @@ name: East 42nd Street sidewalk: both surface: asphalt - road: - highway: primary - lanes: - - type: travel - designated: foot - - type: travel - direction: backward - designated: bus - max_speed: - unit: mph - value: 25 - - type: travel - direction: backward - designated: motor_vehicle - max_speed: - unit: mph - value: 25 - - type: travel - direction: forward - designated: motor_vehicle - max_speed: - unit: mph - value: 25 - - type: travel - direction: forward - designated: bus - max_speed: - unit: mph - value: 25 - - type: travel - designated: foot + output: + - type: travel + designated: foot + - type: travel + direction: backward + designated: bus + max_speed: + unit: mph + value: 25 + - type: travel + direction: backward + designated: motor_vehicle + max_speed: + unit: mph + value: 25 + - type: travel + direction: forward + designated: motor_vehicle + max_speed: + unit: mph + value: 25 + - type: travel + direction: forward + designated: bus + max_speed: + unit: mph + value: 25 + - type: travel + designated: foot ### Combination # TODO @@ -952,12 +900,10 @@ sidewalk: "no" driving_side: left # TODO: nest this so we can check highway type - road: - highway: road - lanes: - - type: travel - direction: forward - designated: motor_vehicle + output: + - type: travel + direction: forward + designated: motor_vehicle ### To Sort # The following still need to be categorized @@ -1054,6 +1000,9 @@ - way_id: 389654080 mapillary: https://www.mapillary.com/app/?pKey=331760328316020 + rust: + # TODO: + # expect_warnings: true # deprecated centre_turn_lane # TODO: the cycleway is actually two marked lanes, # how should we know that given the tags or what should the tags be? tags: @@ -1142,10 +1091,10 @@ mapillary: https://www.mapillary.com/app/?pKey=3687326814728481 comment: "TODO: missing cycleway:left and busway tags" tags: - highway: primary + highway: "primary" lanes: "2" oneway: "yes" - sidewalk: left + sidewalk: "left" driving_side: left output: - type: travel @@ -1158,68 +1107,103 @@ designated: motor_vehicle - way_id: 898731283 - comment: how should an odd number of lanes forward/backwards be split without any clues? + comment: guess that an odd number of lanes will be divided favouring the forward direction with a warning tags: highway: "road" lanes: "3" sidewalk: "both" driving_side: "left" - output: - - type: travel - designated: foot - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - designated: foot + road: + highway: road + lanes: + - type: travel + designated: foot + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + designated: foot # I didn't look for a real example of this - description: "5 lanes" + comment: guess that an odd number of lanes will be divided favouring the forward direction with a warning tags: highway: "road" lanes: "5" sidewalk: "no" driving_side: right - output: - - type: shoulder - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: shoulder + road: + highway: road + lanes: + - type: shoulder + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: shoulder + +- description: assume lanes:forward to be lanes - lanes:backward + skip_python: true + skip_kotlin: true + rust: false + tags: + highway: "secondary" + lanes: "4" + lanes:backward: "1" + sidewalk: "no" + driving_side: right + road: + highway: secondary + lanes: + - type: shoulder + - type: travel + direction: backward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: travel + direction: forward + designated: motor_vehicle + - type: shoulder - way_id: 335668924 + description: a narrow alleyway tagged lanes=1 + skip_python: true + skip_kotlin: true + rust: false tags: - highway: "road" + highway: "service" lanes: "1" - sidewalk: "no" driving_side: right - output: - - type: shoulder - - type: travel - direction: backward - designated: motor_vehicle - - type: travel - direction: forward - designated: motor_vehicle - - type: shoulder + road: + highway: service + lanes: + - type: shoulder + - type: travel + direction: both + designated: motor_vehicle + - type: shoulder - way_id: 13859146 rust: false @@ -1228,8 +1212,8 @@ busway:both: "lane" lanes: "4" maxspeed: "50" - name: Rue Gabriel Péri - ref: D 986 + name: "Rue Gabriel Péri" + ref: "D 986" surface: asphalt driving_side: right output: