interpret OSM tags to figure out bike lanes on one side

This commit is contained in:
Dustin Carlino 2019-10-14 15:05:45 -07:00
parent a55a7d3c48
commit 51352d05a9
2 changed files with 29 additions and 23 deletions

View File

@ -1,21 +1,21 @@
4c9c7857c9c93a9ace0d7d3f50ab165e ../data/screenshots/pending_montlake/01x01_i63.png
9c09986c41ea671b82bc11ca5213eea5 ../data/screenshots/pending_montlake/02x01_i4.png
ca7f864e97a32c46cf25fca9e979fe24 ../data/screenshots/pending_montlake/03x01_i2.png
e4a5aa3418a7e1a4aa5e80551948a567 ../data/screenshots/pending_montlake/01x02_i12.png
8c9df15df691867cb0797fe3de470031 ../data/screenshots/pending_montlake/02x02_i149.png
f33354e834eccc6ccfdf538b8a4b5af4 ../data/screenshots/pending_montlake/03x02_i42.png
f1036466f3d5e2ae9facab920abc2f5a ../data/screenshots/pending_montlake/01x03_i115.png
1729a9fb18aefe01f63fd3884a351d91 ../data/screenshots/pending_montlake/02x03_i8.png
fec81b03936cd932afa474534511e32c ../data/screenshots/pending_montlake/03x03_i19.png
e96be7eeb243a9746e6dfbffd2bf76c4 ../data/screenshots/pending_montlake/01x04_i6.png
cc9e5351baba6d0a2d1211ddd48be6ae ../data/screenshots/pending_montlake/02x04_i34.png
dfd9b4690236f7a2530e60b92b377468 ../data/screenshots/pending_montlake/03x04_i18.png
69f38111ab425fc6aa98454793b10562 ../data/screenshots/pending_montlake/01x05_i51.png
850c21b79bdbf11d1377675a3acdcf1b ../data/screenshots/pending_montlake/02x05_i50.png
47c7f178f344085503365310f61785ba ../data/screenshots/pending_montlake/03x05_i28.png
305f6a4da0099af21eeb2d9c9b0a3e99 ../data/screenshots/pending_montlake/01x06_i16.png
92aeb06ab5dffa8a11284402861b7139 ../data/screenshots/pending_montlake/02x06_i14.png
0d2f06aa474f5509cdc5717142d6c463 ../data/screenshots/pending_montlake/03x06_i24.png
0f2938f6916267c08ab114918a7528e3 ../data/screenshots/pending_montlake/01x07_i123.png
23f8d9473d1f7386623d4381587221cc ../data/screenshots/pending_montlake/02x07_i26.png
4321d01b91f47ab6dbbc98202d5ba6c1 ../data/screenshots/pending_montlake/03x07_i25.png
6a5f5047a0f61a78c36fcd7260a4a506 ../data/screenshots/pending_montlake/01x01_i53.png
65572f268290215e74e66ff747626b73 ../data/screenshots/pending_montlake/02x01_i1.png
79752042ecbb6e2dcc89f416f231fb21 ../data/screenshots/pending_montlake/03x01_i0.png
a168de2ea1b6fbe1a08821427cd67c49 ../data/screenshots/pending_montlake/01x02_i7.png
d4508b352d670dd1270b3a39917ea7be ../data/screenshots/pending_montlake/02x02_i126.png
763c1f574ea1e307e080534313e0e0d5 ../data/screenshots/pending_montlake/03x02_i31.png
9860da65b5583f91fa97fd070b7d1a16 ../data/screenshots/pending_montlake/01x03_i97.png
1729a9fb18aefe01f63fd3884a351d91 ../data/screenshots/pending_montlake/02x03_i5.png
9ac4e293a05010def2886a75d2d3eb87 ../data/screenshots/pending_montlake/03x03_i14.png
487b906ecf19918dd36cea29378bee81 ../data/screenshots/pending_montlake/01x04_i3.png
1d8b15e910503a1b3a5a3f59f666e0da ../data/screenshots/pending_montlake/02x04_i27.png
2b1b8843af14e199badec638d809aa76 ../data/screenshots/pending_montlake/03x04_i13.png
ec0d6acb2a1ee7602839f98a8a8b8554 ../data/screenshots/pending_montlake/01x05_i42.png
f083a9bbd9ab7a01fb9ada6ae9476b8b ../data/screenshots/pending_montlake/02x05_i41.png
e49068d8e47a7766ff1ea574bb96fcee ../data/screenshots/pending_montlake/03x05_i21.png
15da92a39d014bfe581743cb3a5fc8e9 ../data/screenshots/pending_montlake/01x06_i11.png
a375f47d64abe5d8f79af7c6d0e6fd9d ../data/screenshots/pending_montlake/02x06_i9.png
95aff80511b717d8771d437b86142efc ../data/screenshots/pending_montlake/03x06_i17.png
9bfb1627b25967f80ff9b6d99eb57baf ../data/screenshots/pending_montlake/01x07_i104.png
f4d3caf06fab74f7979c8fb3acd9fdee ../data/screenshots/pending_montlake/02x07_i19.png
5db88f23d8eb64a2583faebb6bc3979d ../data/screenshots/pending_montlake/03x07_i18.png

View File

@ -94,12 +94,18 @@ pub fn get_lane_types(osm_tags: &BTreeMap<String, String>) -> (Vec<LaneType>, Ve
}
}
let has_bike_lane = osm_tags.get("cycleway") == Some(&"lane".to_string());
if has_bike_lane {
if osm_tags.get("cycleway") == Some(&"lane".to_string()) {
fwd_side.push(LaneType::Biking);
if !back_side.is_empty() {
back_side.push(LaneType::Biking);
}
} else {
if osm_tags.get("cycleway:right") == Some(&"lane".to_string()) {
fwd_side.push(LaneType::Biking);
}
if osm_tags.get("cycleway:left") == Some(&"lane".to_string()) {
back_side.push(LaneType::Biking);
}
}
// TODO Should we warn when one of these has parking assigned to it from the blockface?