mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +03:00
At last, powered by the tight feedback loop of unit tests, bring in some
two-way cycletracks from OSM!
This commit is contained in:
parent
3d6fb16db1
commit
75933f686d
@ -20,8 +20,8 @@ data/input/raw_maps/south_seattle.bin,b044bda30b5adeed129820b284334599,https://w
|
|||||||
data/input/raw_maps/udistrict.bin,4441415d1f8b6fc32293fde688ecc40d,https://www.dropbox.com/s/p4oscm85fj1mxgb/udistrict.bin.zip?dl=0
|
data/input/raw_maps/udistrict.bin,4441415d1f8b6fc32293fde688ecc40d,https://www.dropbox.com/s/p4oscm85fj1mxgb/udistrict.bin.zip?dl=0
|
||||||
data/input/raw_maps/west_seattle.bin,121ae8600b101dea7fafcc8786a3a5e0,https://www.dropbox.com/s/45c2slhwmmn3jkn/west_seattle.bin.zip?dl=0
|
data/input/raw_maps/west_seattle.bin,121ae8600b101dea7fafcc8786a3a5e0,https://www.dropbox.com/s/45c2slhwmmn3jkn/west_seattle.bin.zip?dl=0
|
||||||
data/input/raw_maps/xian.bin,45d3dff4d99821f387e550950fb5669d,https://www.dropbox.com/s/kjeu0q8ey93l11h/xian.bin.zip?dl=0
|
data/input/raw_maps/xian.bin,45d3dff4d99821f387e550950fb5669d,https://www.dropbox.com/s/kjeu0q8ey93l11h/xian.bin.zip?dl=0
|
||||||
data/input/screenshots/downtown.zip,902b9b22934b255c20d57b23ea6e1a8f,https://www.dropbox.com/s/qawd35wz62m2acl/downtown.zip.zip?dl=0
|
data/input/screenshots/downtown.zip,310baa43b5da519fbc24991b27147c21,https://www.dropbox.com/s/qawd35wz62m2acl/downtown.zip.zip?dl=0
|
||||||
data/input/screenshots/krakow_center.zip,d594bb350a7cccf85532fc70cbe504e2,https://www.dropbox.com/s/azea6v6mnxbe0vc/krakow_center.zip.zip?dl=0
|
data/input/screenshots/krakow_center.zip,800c0f8c713772ddd70a753dcb1f6f82,https://www.dropbox.com/s/azea6v6mnxbe0vc/krakow_center.zip.zip?dl=0
|
||||||
data/input/screenshots/lakeslice.zip,6a439c03cc80d40504d3adb379278f45,https://www.dropbox.com/s/06mwgdt6orow3rk/lakeslice.zip.zip?dl=0
|
data/input/screenshots/lakeslice.zip,6a439c03cc80d40504d3adb379278f45,https://www.dropbox.com/s/06mwgdt6orow3rk/lakeslice.zip.zip?dl=0
|
||||||
data/input/screenshots/montlake.zip,079b018b9d20dbad4ca808f0afd63d33,https://www.dropbox.com/s/eblgq5zj3gflhwx/montlake.zip.zip?dl=0
|
data/input/screenshots/montlake.zip,079b018b9d20dbad4ca808f0afd63d33,https://www.dropbox.com/s/eblgq5zj3gflhwx/montlake.zip.zip?dl=0
|
||||||
data/input/screenshots/udistrict.zip,0fdd7eb086b1b1781f093a9a6a6044b4,https://www.dropbox.com/s/nlyxnfy11qszk50/udistrict.zip.zip?dl=0
|
data/input/screenshots/udistrict.zip,0fdd7eb086b1b1781f093a9a6a6044b4,https://www.dropbox.com/s/nlyxnfy11qszk50/udistrict.zip.zip?dl=0
|
||||||
@ -62,25 +62,25 @@ data/input/xian/osm/china-latest.osm.pbf,0108807f1dc321d5de5579622ac3f4cf,https:
|
|||||||
data/input/xian/osm/xian.osm,4084c665ad947bb40173a43cb33fdec8,https://www.dropbox.com/s/j5qwt33bs077sd2/xian.osm.zip?dl=0
|
data/input/xian/osm/xian.osm,4084c665ad947bb40173a43cb33fdec8,https://www.dropbox.com/s/j5qwt33bs077sd2/xian.osm.zip?dl=0
|
||||||
data/input/xian/service_roads.bin,2130675f49282a5e9fe3db870b089e98,https://www.dropbox.com/s/5djufzeqgdp43ek/service_roads.bin.zip?dl=0
|
data/input/xian/service_roads.bin,2130675f49282a5e9fe3db870b089e98,https://www.dropbox.com/s/5djufzeqgdp43ek/service_roads.bin.zip?dl=0
|
||||||
data/system/cities/seattle.bin,91f8ed0b5da81b5f757448a2a2e7da89,https://www.dropbox.com/s/8fnapw0rcxo54kk/seattle.bin.zip?dl=0
|
data/system/cities/seattle.bin,91f8ed0b5da81b5f757448a2a2e7da89,https://www.dropbox.com/s/8fnapw0rcxo54kk/seattle.bin.zip?dl=0
|
||||||
data/system/maps/ballard.bin,e09377b51c22c917634cba750e6c53e0,https://www.dropbox.com/s/0hx1uddr5c48bkv/ballard.bin.zip?dl=0
|
data/system/maps/ballard.bin,72fd71140ced183e0da844dfc6f1b8fe,https://www.dropbox.com/s/sihq0wnno6txl2b/ballard.bin.zip?dl=0
|
||||||
data/system/maps/berlin_center.bin,c07386b2981a8c96ff7f7a9288371481,https://www.dropbox.com/s/brjdb7mufdx84ft/berlin_center.bin.zip?dl=0
|
data/system/maps/berlin_center.bin,44b1a3b5e234a8be66ed6c0d4970d67e,https://www.dropbox.com/s/rvq2x685rq4t93p/berlin_center.bin.zip?dl=0
|
||||||
data/system/maps/downtown.bin,ee92fdb820af3f83d1d2f696248745c3,https://www.dropbox.com/s/lii4g83yc8ju5jx/downtown.bin.zip?dl=0
|
data/system/maps/downtown.bin,7862b97b00d6bae7eb842f15979dad77,https://www.dropbox.com/s/azus8tqnq2jc42n/downtown.bin.zip?dl=0
|
||||||
data/system/maps/huge_seattle.bin,0509be1be236ef879826f8383dc69ced,https://www.dropbox.com/s/zpzi6mh43gn1mpe/huge_seattle.bin.zip?dl=0
|
data/system/maps/huge_seattle.bin,410e4ae5fd3b4bf9b759e0c062a83d36,https://www.dropbox.com/s/js04yd17y2kofkh/huge_seattle.bin.zip?dl=0
|
||||||
data/system/maps/krakow_center.bin,bc4efabab44d4b9e56dfdb209583b1f4,https://www.dropbox.com/s/w497r611169j7g8/krakow_center.bin.zip?dl=0
|
data/system/maps/krakow_center.bin,356df3ac5650ccd607792cbec8809200,https://www.dropbox.com/s/d5ucfrsn6pfrm23/krakow_center.bin.zip?dl=0
|
||||||
data/system/maps/lakeslice.bin,5311c3728a76fd78916faeae8fddd572,https://www.dropbox.com/s/ipcdlm1m2rumwyo/lakeslice.bin.zip?dl=0
|
data/system/maps/lakeslice.bin,5311c3728a76fd78916faeae8fddd572,https://www.dropbox.com/s/ipcdlm1m2rumwyo/lakeslice.bin.zip?dl=0
|
||||||
data/system/maps/montlake.bin,6ca284783ce83e915282476cf99e04cc,https://www.dropbox.com/s/wyybiw5y7z3gdoc/montlake.bin.zip?dl=0
|
data/system/maps/montlake.bin,6ca284783ce83e915282476cf99e04cc,https://www.dropbox.com/s/wyybiw5y7z3gdoc/montlake.bin.zip?dl=0
|
||||||
data/system/maps/south_seattle.bin,ee1e1d17986994c783d89a641995e3dc,https://www.dropbox.com/s/21rkr4xbs0ei6f8/south_seattle.bin.zip?dl=0
|
data/system/maps/south_seattle.bin,47096a54d508341170e909b09f814dd7,https://www.dropbox.com/s/92a2s0iyt95u2b2/south_seattle.bin.zip?dl=0
|
||||||
data/system/maps/udistrict.bin,d2773d20a171843b7b6c805f350d4cf5,https://www.dropbox.com/s/y03l06emjmtjp32/udistrict.bin.zip?dl=0
|
data/system/maps/udistrict.bin,d2773d20a171843b7b6c805f350d4cf5,https://www.dropbox.com/s/y03l06emjmtjp32/udistrict.bin.zip?dl=0
|
||||||
data/system/maps/west_seattle.bin,df580b7566bb9d57a2605cf4affa741d,https://www.dropbox.com/s/a9ws18sar0l5tns/west_seattle.bin.zip?dl=0
|
data/system/maps/west_seattle.bin,df580b7566bb9d57a2605cf4affa741d,https://www.dropbox.com/s/a9ws18sar0l5tns/west_seattle.bin.zip?dl=0
|
||||||
data/system/maps/xian.bin,fe0b3775cc141c735870104b70339db0,https://www.dropbox.com/s/w7g13kgn8a1girv/xian.bin.zip?dl=0
|
data/system/maps/xian.bin,fe0b3775cc141c735870104b70339db0,https://www.dropbox.com/s/w7g13kgn8a1girv/xian.bin.zip?dl=0
|
||||||
data/system/prebaked_results/lakeslice/weekday.bin,0bf9dbdffce55af5c744cf5b67fde9ef,https://www.dropbox.com/s/wjz40yq7qtusib1/weekday.bin.zip?dl=0
|
data/system/prebaked_results/lakeslice/weekday.bin,fce6ca79a0db0e18ddee6eed278dd3e8,https://www.dropbox.com/s/z6kdmrak7v474vr/weekday.bin.zip?dl=0
|
||||||
data/system/prebaked_results/montlake/car vs bike contention.bin,5928aa529033e398fe6d256afe21c2ab,https://www.dropbox.com/s/jefg0ikjy9dsrdd/car%20vs%20bike%20contention.bin.zip?dl=0
|
data/system/prebaked_results/montlake/car vs bike contention.bin,5928aa529033e398fe6d256afe21c2ab,https://www.dropbox.com/s/jefg0ikjy9dsrdd/car%20vs%20bike%20contention.bin.zip?dl=0
|
||||||
data/system/prebaked_results/montlake/weekday.bin,bba1b0cc028a247e3b80bf9598deb96e,https://www.dropbox.com/s/69pn93gjruj7nbe/weekday.bin.zip?dl=0
|
data/system/prebaked_results/montlake/weekday.bin,8aa6120acd559486058feb6de8b8b376,https://www.dropbox.com/s/xk8lpp9vbmmgnv0/weekday.bin.zip?dl=0
|
||||||
data/system/scenarios/ballard/weekday.bin,8acef43ec03c6587eada655b928797d8,https://www.dropbox.com/s/z6g9rq036rm9ac0/weekday.bin.zip?dl=0
|
data/system/scenarios/ballard/weekday.bin,d1b13d9c12c8e76d045f02adf78a5c0b,https://www.dropbox.com/s/c2ouuxx0w354jna/weekday.bin.zip?dl=0
|
||||||
data/system/scenarios/downtown/weekday.bin,ab864770a7f0300ab504fdf5224f178b,https://www.dropbox.com/s/ifxoftp4ovhio4g/weekday.bin.zip?dl=0
|
data/system/scenarios/downtown/weekday.bin,08d0e8b0772a317f071f23325d132944,https://www.dropbox.com/s/6myqpydj4ded8db/weekday.bin.zip?dl=0
|
||||||
data/system/scenarios/huge_seattle/weekday.bin,30ecda606fb4fa0eb43ff261631051e6,https://www.dropbox.com/s/nwtjdd5j09lt9h7/weekday.bin.zip?dl=0
|
data/system/scenarios/huge_seattle/weekday.bin,7e67ecb766f7da43aad3c6c70bb9fe48,https://www.dropbox.com/s/7nsyz2mp0zdc4en/weekday.bin.zip?dl=0
|
||||||
data/system/scenarios/lakeslice/weekday.bin,839514165f40bdcdd955b6e942cb8806,https://www.dropbox.com/s/b4h2jpqw445fpmr/weekday.bin.zip?dl=0
|
data/system/scenarios/lakeslice/weekday.bin,cc1a06a4885b313a9a4812e27314c0ea,https://www.dropbox.com/s/icpl9paebveedj7/weekday.bin.zip?dl=0
|
||||||
data/system/scenarios/montlake/weekday.bin,23f06f74e147635c1ba748ef5f723bf8,https://www.dropbox.com/s/zc955a7riqh3you/weekday.bin.zip?dl=0
|
data/system/scenarios/montlake/weekday.bin,9c7b530af4c326464aa0b6794a9a5d53,https://www.dropbox.com/s/r7vo9injkzdkdoq/weekday.bin.zip?dl=0
|
||||||
data/system/scenarios/south_seattle/weekday.bin,191eabc8480da13efa3f5029063990d2,https://www.dropbox.com/s/noqwhpqrbbqf5tv/weekday.bin.zip?dl=0
|
data/system/scenarios/south_seattle/weekday.bin,4157bb7649bdf4bb2fae76547a89fca4,https://www.dropbox.com/s/3p1s1lpm9oxf2xb/weekday.bin.zip?dl=0
|
||||||
data/system/scenarios/udistrict/weekday.bin,a733978ecad4bad02ef4b4644897ae62,https://www.dropbox.com/s/20aobtewhk2cx7g/weekday.bin.zip?dl=0
|
data/system/scenarios/udistrict/weekday.bin,c737fc396889dd2802eb19f2d4f12e32,https://www.dropbox.com/s/s2ruerzrblm748m/weekday.bin.zip?dl=0
|
||||||
data/system/scenarios/west_seattle/weekday.bin,ebc9a2f51e888bf94382a7fb1d74307f,https://www.dropbox.com/s/kg99atx79093qkb/weekday.bin.zip?dl=0
|
data/system/scenarios/west_seattle/weekday.bin,78c849b41a47a244fa5337f9908dc815,https://www.dropbox.com/s/d4xorlgwldyvmjj/weekday.bin.zip?dl=0
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
https://www.openstreetmap.org/relation/8624462 from Lane #6374 to None
|
https://www.openstreetmap.org/relation/8624462 from Lane #6378 to None
|
||||||
3rd Ave & Madison St: Position(Lane #13845, 64.6052m) driving, Position(Lane #13844, 64.6446m) sidewalk
|
3rd Ave & Madison St: Position(Lane #13875, 64.6052m) driving, Position(Lane #13874, 64.6446m) sidewalk
|
||||||
3rd Ave & Union St: Position(Lane #9797, 86.6295m) driving, Position(Lane #9798, 86.6407m) sidewalk
|
3rd Ave & Union St: Position(Lane #9811, 86.6295m) driving, Position(Lane #9812, 86.6407m) sidewalk
|
||||||
https://www.openstreetmap.org/relation/8624463 from Lane #6374 to None
|
https://www.openstreetmap.org/relation/8624463 from Lane #6378 to None
|
||||||
3rd Ave & Madison St: Position(Lane #13845, 64.6052m) driving, Position(Lane #13844, 64.6446m) sidewalk
|
3rd Ave & Madison St: Position(Lane #13875, 64.6052m) driving, Position(Lane #13874, 64.6446m) sidewalk
|
||||||
3rd Ave & Union St: Position(Lane #9797, 86.6295m) driving, Position(Lane #9798, 86.6407m) sidewalk
|
3rd Ave & Union St: Position(Lane #9811, 86.6295m) driving, Position(Lane #9812, 86.6407m) sidewalk
|
||||||
https://www.openstreetmap.org/relation/9338838 from Lane #6374 to None
|
https://www.openstreetmap.org/relation/9338838 from Lane #6378 to None
|
||||||
3rd Ave & Madison St: Position(Lane #13845, 64.6052m) driving, Position(Lane #13844, 64.6446m) sidewalk
|
3rd Ave & Madison St: Position(Lane #13875, 64.6052m) driving, Position(Lane #13874, 64.6446m) sidewalk
|
||||||
3rd Ave & Union St: Position(Lane #9797, 86.6295m) driving, Position(Lane #9798, 86.6407m) sidewalk
|
3rd Ave & Union St: Position(Lane #9811, 86.6295m) driving, Position(Lane #9812, 86.6407m) sidewalk
|
||||||
https://www.openstreetmap.org/relation/9341184 from Lane #6374 to None
|
https://www.openstreetmap.org/relation/9341184 from Lane #6378 to None
|
||||||
3rd Ave & Madison St: Position(Lane #13845, 64.6052m) driving, Position(Lane #13844, 64.6446m) sidewalk
|
3rd Ave & Madison St: Position(Lane #13875, 64.6052m) driving, Position(Lane #13874, 64.6446m) sidewalk
|
||||||
3rd Ave & Union St: Position(Lane #9797, 86.6295m) driving, Position(Lane #9798, 86.6407m) sidewalk
|
3rd Ave & Union St: Position(Lane #9811, 86.6295m) driving, Position(Lane #9812, 86.6407m) sidewalk
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
https://www.openstreetmap.org/relation/2053781 from Lane #4489 to Some(LaneID(8696))
|
https://www.openstreetmap.org/relation/2053781 from Lane #4490 to Some(LaneID(8705))
|
||||||
Politechnika: Position(Lane #4489, 68.497m) driving, Position(Lane #8197, 15.9997m) sidewalk
|
Politechnika: Position(Lane #4490, 68.497m) driving, Position(Lane #8206, 15.9997m) sidewalk
|
||||||
Nowy Kleparz: Position(Lane #6489, 20.3364m) driving, Position(Lane #6490, 30.8147m) sidewalk
|
Nowy Kleparz: Position(Lane #6496, 20.3364m) driving, Position(Lane #6497, 30.8147m) sidewalk
|
||||||
|
@ -183,12 +183,15 @@ pub fn get_lane_specs_ltr(tags: &Tags) -> Vec<LaneSpec> {
|
|||||||
back_side.push(back(LaneType::Biking));
|
back_side.push(back(LaneType::Biking));
|
||||||
} else {
|
} else {
|
||||||
if tags.is_any("cycleway:right", vec!["lane", "track"]) {
|
if tags.is_any("cycleway:right", vec!["lane", "track"]) {
|
||||||
|
if tags.is("cycleway:right:oneway", "no") || tags.is("oneway:bicycle", "no") {
|
||||||
|
fwd_side.push(back(LaneType::Biking));
|
||||||
|
}
|
||||||
fwd_side.push(fwd(LaneType::Biking));
|
fwd_side.push(fwd(LaneType::Biking));
|
||||||
}
|
}
|
||||||
if tags.is("cycleway:left", "opposite_lane") || tags.is("cycleway", "opposite_lane") {
|
if tags.is("cycleway:left", "opposite_lane") || tags.is("cycleway", "opposite_lane") {
|
||||||
back_side.push(back(LaneType::Biking));
|
back_side.push(back(LaneType::Biking));
|
||||||
}
|
}
|
||||||
if tags.is_any("cycleway:left", vec!["lane", "track"]) {
|
if tags.is_any("cycleway:left", vec!["lane", "opposite_track", "track"]) {
|
||||||
if oneway {
|
if oneway {
|
||||||
fwd_side.insert(0, fwd(LaneType::Biking));
|
fwd_side.insert(0, fwd(LaneType::Biking));
|
||||||
} else {
|
} else {
|
||||||
@ -297,9 +300,9 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_osm_to_specs() {
|
fn test_osm_to_specs() {
|
||||||
let mut ok = true;
|
let mut ok = true;
|
||||||
for (input, expected_lt, expected_dir) in vec![
|
for (url, input, expected_lt, expected_dir) in vec![
|
||||||
(
|
(
|
||||||
// https://www.openstreetmap.org/way/428294122
|
"https://www.openstreetmap.org/way/428294122",
|
||||||
vec![
|
vec![
|
||||||
"lanes=2",
|
"lanes=2",
|
||||||
"oneway=yes",
|
"oneway=yes",
|
||||||
@ -310,7 +313,7 @@ mod tests {
|
|||||||
"v^^^^",
|
"v^^^^",
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
// https://www.openstreetmap.org/way/8591383
|
"https://www.openstreetmap.org/way/8591383",
|
||||||
vec![
|
vec![
|
||||||
"lanes=1",
|
"lanes=1",
|
||||||
"oneway=yes",
|
"oneway=yes",
|
||||||
@ -321,6 +324,45 @@ mod tests {
|
|||||||
"sbbds",
|
"sbbds",
|
||||||
"vv^^^",
|
"vv^^^",
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"https://www.openstreetmap.org/way/353690151",
|
||||||
|
vec![
|
||||||
|
"lanes=4",
|
||||||
|
"sidewalk=both",
|
||||||
|
"parking:lane:both=parallel",
|
||||||
|
"cycleway:right=track",
|
||||||
|
"cycleway:right:oneway=no",
|
||||||
|
],
|
||||||
|
"spddddbbps",
|
||||||
|
"vvvv^^v^^^",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"https://www.openstreetmap.org/way/389654080",
|
||||||
|
vec![
|
||||||
|
"lanes=2",
|
||||||
|
"sidewalk=both",
|
||||||
|
"parking:lane:left=parallel",
|
||||||
|
"parking:lane:right=no_stopping",
|
||||||
|
"centre_turn_lane=yes",
|
||||||
|
"cycleway:right=track",
|
||||||
|
"cycleway:right:oneway=no",
|
||||||
|
],
|
||||||
|
"spdCdbbs",
|
||||||
|
"vvv^^v^^",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"https://www.openstreetmap.org/way/369623526",
|
||||||
|
vec![
|
||||||
|
"lanes=1",
|
||||||
|
"oneway=yes",
|
||||||
|
"sidewalk=both",
|
||||||
|
"parking:lane:right=diagonal",
|
||||||
|
"cycleway:left=opposite_track",
|
||||||
|
"oneway:bicycle=no",
|
||||||
|
],
|
||||||
|
"sbbdps",
|
||||||
|
"vv^^^^",
|
||||||
|
),
|
||||||
] {
|
] {
|
||||||
let actual = get_lane_specs_ltr(&tags(input.clone()));
|
let actual = get_lane_specs_ltr(&tags(input.clone()));
|
||||||
let actual_lt = actual
|
let actual_lt = actual
|
||||||
@ -335,7 +377,7 @@ mod tests {
|
|||||||
.join("");
|
.join("");
|
||||||
if actual_lt != expected_lt || actual_dir != expected_dir {
|
if actual_lt != expected_lt || actual_dir != expected_dir {
|
||||||
ok = false;
|
ok = false;
|
||||||
println!("For input:");
|
println!("For input (example from {}):", url);
|
||||||
for kv in input {
|
for kv in input {
|
||||||
println!(" {}", kv);
|
println!(" {}", kv);
|
||||||
}
|
}
|
||||||
@ -345,6 +387,7 @@ mod tests {
|
|||||||
println!("Expected:");
|
println!("Expected:");
|
||||||
println!(" {}", expected_lt);
|
println!(" {}", expected_lt);
|
||||||
println!(" {}", expected_dir);
|
println!(" {}", expected_dir);
|
||||||
|
println!("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert!(ok);
|
assert!(ok);
|
||||||
|
Loading…
Reference in New Issue
Block a user