Get a small unit testable repro of #428

This commit is contained in:
Dustin Carlino 2020-12-17 11:11:17 -08:00
parent 42d833ec3f
commit c256c5ebee
3 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,10 @@
TurnID(Lane #2, Lane #6, Intersection #0) is a SharedSidewalkCorner
TurnID(Lane #4, Lane #9, Intersection #0) is a Right
TurnID(Lane #4, Lane #10, Intersection #0) is a Right
TurnID(Lane #5, Lane #11, Intersection #0) is a SharedSidewalkCorner
TurnID(Lane #6, Lane #2, Intersection #0) is a SharedSidewalkCorner
TurnID(Lane #6, Lane #11, Intersection #0) is a Crosswalk
TurnID(Lane #7, Lane #0, Intersection #0) is a Right
TurnID(Lane #7, Lane #1, Intersection #0) is a Right
TurnID(Lane #11, Lane #5, Intersection #0) is a SharedSidewalkCorner
TurnID(Lane #11, Lane #6, Intersection #0) is a Crosswalk

View File

@ -0,0 +1,47 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Resembles https://www.openstreetmap.org/node/2706256854: a two-way road splits into a divided highway. -->
<osm>
<bounds minlon="0.0" maxlon="0.001" minlat="0.0" maxlat="0.001"/>
<node id="1" lon="0.0005" lat="0.0005"/>
<node id="2" lon="0.9" lat="-0.2"/>
<node id="3" lon="0.9" lat="0.2"/>
<node id="4" lon="-0.1" lat="0.0005"/>
<node id="5" lon="1.0" lat="0.0005"/>
<way id="100">
<nd ref="1"/>
<nd ref="2"/>
<tag k="name" v="outbound"/>
<tag k="highway" v="residential"/>
<tag k="dual_carriageway" v="yes"/>
<tag k="lanes" v="2"/>
<tag k="oneway" v="yes"/>
</way>
<way id="101">
<nd ref="3"/>
<nd ref="1"/>
<tag k="name" v="inbound"/>
<tag k="highway" v="residential"/>
<tag k="dual_carriageway" v="yes"/>
<tag k="lanes" v="2"/>
<tag k="oneway" v="yes"/>
</way>
<way id="102">
<nd ref="1"/>
<nd ref="4"/>
<tag k="name" v="bidi"/>
<tag k="highway" v="residential"/>
<tag k="sidewalk" v="both"/>
<tag k="lanes" v="4"/>
<tag k="lanes:forward" v="2"/>
<tag k="lanes:backward" v="2"/>
</way>
<relation id="1000">
<member type="way" ref="101" role="from"/>
<member type="node" ref="1" role="via"/>
<member type="way" ref="100" role="to"/>
<tag k="type" v="restriction"/>
<tag k="restriction" v="no_left_turn"/>
</relation>
</osm>

View File

@ -25,7 +25,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
/// when they change. The goldenfiles (and changes to them) themselves aren't easy to understand,
/// but the test maps are.
fn test_map_importer() -> Result<(), std::io::Error> {
for name in vec!["left_turn_and_bike_lane", "multiple_left_turn_lanes"] {
for name in vec![
"divided_highway_split",
"left_turn_and_bike_lane",
"multiple_left_turn_lanes",
] {
// TODO It's kind of a hack to reference the crate's directory relative to the data dir.
let map = import_map(abstutil::path(format!("../tests/input/{}.osm", name)));
// Enable to debug the result wih the normal GUI