mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 17:34:58 +03:00
dont put sidewalks on a roundabout that's explicitly tagged. fixes #165
this actually disconnects the boyer roundabout (which is tagged correctly in OSM, but not using the separate sidewalks yet). fine for now, might add a temporary override later
This commit is contained in:
parent
94512d95b9
commit
b91d6365e0
@ -11,10 +11,10 @@ data/input/raw_maps/montlake.bin,749507726d6acc94fbde892bf78bd137,https://www.dr
|
||||
data/input/raw_maps/south_seattle.bin,4dba5a22610c3ce88fc45b705a682e19,https://www.dropbox.com/s/xa6bmlxa7a25l2k/south_seattle.bin.zip?dl=0
|
||||
data/input/raw_maps/udistrict.bin,d0dee6bcc4d48865679e940259068b6a,https://www.dropbox.com/s/pordmxw0adnujec/udistrict.bin.zip?dl=0
|
||||
data/input/raw_maps/west_seattle.bin,1a7f2dc27fe28a5af452daf16086351c,https://www.dropbox.com/s/cunj31v1z0ju4k8/west_seattle.bin.zip?dl=0
|
||||
data/input/screenshots/downtown.zip,8a3b19b42e65d0d908dba97d49e0fa92,https://www.dropbox.com/s/qawd35wz62m2acl/downtown.zip.zip?dl=0
|
||||
data/input/screenshots/lakeslice.zip,113d630e7e03ca8f85c521d3d0c42004,https://www.dropbox.com/s/z0z96lsn7bunqfy/lakeslice.zip.zip?dl=0
|
||||
data/input/screenshots/montlake.zip,e5f67c5cf572e2b8d30f5bc10c264662,https://www.dropbox.com/s/r9vkgwesqklfuq2/montlake.zip.zip?dl=0
|
||||
data/input/screenshots/udistrict.zip,9d44d66fff69a6e27a9db86a4245afe7,https://www.dropbox.com/s/ecnt1tyza48y9o2/udistrict.zip.zip?dl=0
|
||||
data/input/screenshots/downtown.zip,2868a4395fb44133d921c3ae204aeb75,https://www.dropbox.com/s/qawd35wz62m2acl/downtown.zip.zip?dl=0
|
||||
data/input/screenshots/lakeslice.zip,d84c54b7a5317ae6c6f7911da5e5a0ff,https://www.dropbox.com/s/z0z96lsn7bunqfy/lakeslice.zip.zip?dl=0
|
||||
data/input/screenshots/montlake.zip,fb78aa7700bd6ed4fc2b99d017a8b534,https://www.dropbox.com/s/r9vkgwesqklfuq2/montlake.zip.zip?dl=0
|
||||
data/input/screenshots/udistrict.zip,7b288c8f73d0690e28db15abbd76372b,https://www.dropbox.com/s/ecnt1tyza48y9o2/udistrict.zip.zip?dl=0
|
||||
data/input/seattle/N47W122.hgt,0db4e23e51f7680538b0bbbc72208e07,https://www.dropbox.com/s/mmb4mgutwotijdw/N47W122.hgt.zip?dl=0
|
||||
data/input/seattle/blockface.bin,add872bab9040ae911366328a230f8b5,https://www.dropbox.com/s/rxd2care60tbe75/blockface.bin.zip?dl=0
|
||||
data/input/seattle/blockface.kml,350bd9e59bf2af4e885a7c0741e6ee6b,https://www.dropbox.com/s/ukknmpjdvilncq9/blockface.kml.zip?dl=0
|
||||
@ -29,31 +29,31 @@ data/input/seattle/osm/south_seattle.osm,a415c8d714d0f4934c2f8c79ca6d5a2d,https:
|
||||
data/input/seattle/osm/udistrict.osm,dd3b931047f54b1a14f2efdb6f9420e0,https://www.dropbox.com/s/0e4ig7ln7y0vodw/udistrict.osm.zip?dl=0
|
||||
data/input/seattle/osm/washington-latest.osm.pbf,ef33a41125145695082088e34f57ae7d,https://www.dropbox.com/s/ty2ursd4szd67uu/washington-latest.osm.pbf.zip?dl=0
|
||||
data/input/seattle/osm/west_seattle.osm,a28b390b3a8612fb993799c57917fba3,https://www.dropbox.com/s/8l2q3e28narajfw/west_seattle.osm.zip?dl=0
|
||||
data/input/seattle/parcels.bin,94926739d0588077ed99f71b4736312e,https://www.dropbox.com/s/cdqz06s8gbijt7f/parcels.bin.zip?dl=0
|
||||
data/input/seattle/parcels.bin,df2fcc206e604edafe4f2387fe72a027,https://www.dropbox.com/s/d2hahu8b3roicah/parcels.bin.zip?dl=0
|
||||
data/input/seattle/parcels_urbansim.txt,db63d7d606e8702d12f9399e87e6a00f,https://www.dropbox.com/s/6g8rbsf200dssj3/parcels_urbansim.txt.zip?dl=0
|
||||
data/input/seattle/popdat.bin,7b49f07a1e9c34c68fa390d03f1cff2f,https://www.dropbox.com/s/r1riqn6kqsh7p5q/popdat.bin.zip?dl=0
|
||||
data/input/seattle/sidewalks.bin,034dd47ab77902dbc81c0107f13d8965,https://www.dropbox.com/s/ma9bmisijc7v7xa/sidewalks.bin.zip?dl=0
|
||||
data/input/seattle/sidewalks.kml,94d385ba03ef1b57a5ba10965913ec6c,https://www.dropbox.com/s/vn8amar9xi6vbvh/sidewalks.kml.zip?dl=0
|
||||
data/input/seattle/trips_2014.csv,d4a8e733045b28c0385fb81359d6df03,https://www.dropbox.com/s/5ppravwmk6bf20d/trips_2014.csv.zip?dl=0
|
||||
data/system/cities/seattle.bin,65ed19fe6b0a41d57ccb481a5c76652a,https://www.dropbox.com/s/kwei76ih7g12n1r/seattle.bin.zip?dl=0
|
||||
data/system/maps/ballard.bin,865bb745867ecc85b0280e62dfb6a5af,https://www.dropbox.com/s/amfiq7vmluiwgfx/ballard.bin.zip?dl=0
|
||||
data/system/maps/ballard.bin,a8a84cc5b3d05ee273b7050af879a03b,https://www.dropbox.com/s/s5ey5ntucyk7ugt/ballard.bin.zip?dl=0
|
||||
data/system/maps/downtown.bin,997b3b1b570f7528ca196588eb5ebdda,https://www.dropbox.com/s/eqbye5eclma68ce/downtown.bin.zip?dl=0
|
||||
data/system/maps/downtown_atx.bin,2168409c2581160293433de059179645,https://www.dropbox.com/s/4yso42ken5j1k0b/downtown_atx.bin.zip?dl=0
|
||||
data/system/maps/huge_austin.bin,698c944a9c162382c7aa23bfd460b741,https://www.dropbox.com/s/a3fah2b63loy9w0/huge_austin.bin.zip?dl=0
|
||||
data/system/maps/huge_seattle.bin,9338477634ab85304e44870dfb2b0097,https://www.dropbox.com/s/q8ollh7b9omjyoc/huge_seattle.bin.zip?dl=0
|
||||
data/system/maps/downtown_atx.bin,deff9dc5aaf63e1f758bfc9d60c0c682,https://www.dropbox.com/s/tdq0osrh7kkany1/downtown_atx.bin.zip?dl=0
|
||||
data/system/maps/huge_austin.bin,d2fc4271d300d342a160a42640473cde,https://www.dropbox.com/s/pmo7thld25apu1x/huge_austin.bin.zip?dl=0
|
||||
data/system/maps/huge_seattle.bin,f67a5017f3bdad1684d069517ef169fd,https://www.dropbox.com/s/ucafzgn16pafi24/huge_seattle.bin.zip?dl=0
|
||||
data/system/maps/lakeslice.bin,5d087682896ce40327c86e2a5aea71a0,https://www.dropbox.com/s/fjlmaa2phx1p3y7/lakeslice.bin.zip?dl=0
|
||||
data/system/maps/montlake.bin,924bd904cc5a29bf05584ab3a68261b2,https://www.dropbox.com/s/u3ypa483e6wxj1b/montlake.bin.zip?dl=0
|
||||
data/system/maps/south_seattle.bin,f9204f0a3dc58c4105e5870ac33d46fb,https://www.dropbox.com/s/eewgxqvktfp9u7s/south_seattle.bin.zip?dl=0
|
||||
data/system/maps/montlake.bin,8a784d4f48392662ac5901818ff992df,https://www.dropbox.com/s/v1pqna4f1w7p51j/montlake.bin.zip?dl=0
|
||||
data/system/maps/south_seattle.bin,b7d755b4d0ecb45365e1888b17b32704,https://www.dropbox.com/s/umdh2k3osplgyu3/south_seattle.bin.zip?dl=0
|
||||
data/system/maps/udistrict.bin,501cfbbc3fb2591ac067994c00c84151,https://www.dropbox.com/s/73jliqhi4qk4v1a/udistrict.bin.zip?dl=0
|
||||
data/system/maps/west_seattle.bin,b79efdf8e80f3540f7c57618575db9c7,https://www.dropbox.com/s/s08nwg6ngxdm2ua/west_seattle.bin.zip?dl=0
|
||||
data/system/prebaked_results/lakeslice/weekday.bin,e96a1759413b49b000ef71aaf8050f6b,https://www.dropbox.com/s/nlvmsmio9npmg05/weekday.bin.zip?dl=0
|
||||
data/system/maps/west_seattle.bin,7b2fb9d47ff097965fc6181428441fc7,https://www.dropbox.com/s/m1xssiy7vwh00dz/west_seattle.bin.zip?dl=0
|
||||
data/system/prebaked_results/lakeslice/weekday.bin,d6e7713b4f591fcc6e76f47e2c4b04d2,https://www.dropbox.com/s/3n1a8cwcrja4ujk/weekday.bin.zip?dl=0
|
||||
data/system/prebaked_results/montlake/car vs bike contention.bin,75f4d00c72ffe575d65bcfbe21315b2e,https://www.dropbox.com/s/jefg0ikjy9dsrdd/car%20vs%20bike%20contention.bin.zip?dl=0
|
||||
data/system/prebaked_results/montlake/weekday.bin,39577f477b87f3139e3ac0b3398d549d,https://www.dropbox.com/s/hxbq4tp9o8hszg8/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/ballard/weekday.bin,06d94e95d8bf547d6b27873fc3bfd809,https://www.dropbox.com/s/wy6jdez1hrercht/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/downtown/weekday.bin,aa9001b9e5122f41cc418ad9d4f2a0f9,https://www.dropbox.com/s/bjorhyiaaycvv8l/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/huge_seattle/weekday.bin,8847edb454190e37fbfc8a51ab3ae85e,https://www.dropbox.com/s/gmhqr4lybefi2wr/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/lakeslice/weekday.bin,e5ad59ecd38920decc4bf13299357a37,https://www.dropbox.com/s/p8qeolvtn3cku54/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/montlake/weekday.bin,ccbdd73f5abec2280228de694442d4d7,https://www.dropbox.com/s/q5htpdaqh7l3djw/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/south_seattle/weekday.bin,71a4db0e198e074feaaa472ee4a4670d,https://www.dropbox.com/s/j1610fnnrftx8ky/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/udistrict/weekday.bin,0a44037b42c094e6c08b567b4ac37de1,https://www.dropbox.com/s/3i430dyw2qa6mgh/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/west_seattle/weekday.bin,fb016155461ccd8fb1060eccc669aed5,https://www.dropbox.com/s/zp1ysyawt66tosg/weekday.bin.zip?dl=0
|
||||
data/system/prebaked_results/montlake/weekday.bin,5e64c31fd7f99840c47c6c8d4acdc071,https://www.dropbox.com/s/rggnturuxlww5pu/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/ballard/weekday.bin,279303f4ad9b3dd11c417b085e3fcbaa,https://www.dropbox.com/s/316pz7ekwsust3w/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/downtown/weekday.bin,b6cec090d39d95e4c3b61cf854d540fa,https://www.dropbox.com/s/64xdvbj3qixauy5/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/huge_seattle/weekday.bin,ecf46d113aa6d71e27bf82ce6c491b1b,https://www.dropbox.com/s/bhcdc69jqvhkpj9/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/lakeslice/weekday.bin,c58e9ec4463313c393030948800c7328,https://www.dropbox.com/s/zha980q7nvtmvs7/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/montlake/weekday.bin,efae50a1e4af842491d924a63ead0fc7,https://www.dropbox.com/s/p14lx1b34ugniiy/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/south_seattle/weekday.bin,3511bf773a366ad74085e9511e6919a6,https://www.dropbox.com/s/g8153i0uvp26i5i/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/udistrict/weekday.bin,3a47fee464d98af1ae43fa9443264f3a,https://www.dropbox.com/s/clm4umoqzcmunoi/weekday.bin.zip?dl=0
|
||||
data/system/scenarios/west_seattle/weekday.bin,0de4cede1489f82880fa55e6303d32c6,https://www.dropbox.com/s/2ftwxd3qesg1maj/weekday.bin.zip?dl=0
|
||||
|
@ -5,6 +5,8 @@ use std::{fmt, iter};
|
||||
|
||||
// (original direction, reversed direction)
|
||||
pub fn get_lane_types(osm_tags: &BTreeMap<String, String>) -> (Vec<LaneType>, Vec<LaneType>) {
|
||||
let tags = Tags(osm_tags);
|
||||
|
||||
if let Some(s) = osm_tags.get(osm::SYNTHETIC_LANES) {
|
||||
if let Some(spec) = RoadSpec::parse(s.to_string()) {
|
||||
return (spec.fwd, spec.back);
|
||||
@ -14,19 +16,21 @@ pub fn get_lane_types(osm_tags: &BTreeMap<String, String>) -> (Vec<LaneType>, Ve
|
||||
}
|
||||
|
||||
// Easy special cases first.
|
||||
if osm_tags.get("railway") == Some(&"light_rail".to_string()) {
|
||||
if tags.is("railway", "light_rail") {
|
||||
return (vec![LaneType::LightRail], Vec::new());
|
||||
}
|
||||
if osm_tags.get("junction") == Some(&"roundabout".to_string()) {
|
||||
if tags.is("junction", "roundabout") {
|
||||
if tags.is(osm::SIDEWALK, "no") || tags.is(osm::SIDEWALK, "none") || tags.is("foot", "no") {
|
||||
return (vec![LaneType::Driving], Vec::new());
|
||||
}
|
||||
return (vec![LaneType::Driving, LaneType::Sidewalk], Vec::new());
|
||||
}
|
||||
if osm_tags.get(osm::HIGHWAY) == Some(&"footway".to_string()) {
|
||||
if tags.is(osm::HIGHWAY, "footway") {
|
||||
return (vec![LaneType::Sidewalk], Vec::new());
|
||||
}
|
||||
|
||||
// TODO Reversible roads should be handled differently?
|
||||
let oneway = osm_tags.get("oneway") == Some(&"yes".to_string())
|
||||
|| osm_tags.get("oneway") == Some(&"reversible".to_string());
|
||||
let oneway = tags.is("oneway", "yes") || tags.is("oneway", "reversible");
|
||||
|
||||
// How many driving lanes in each direction?
|
||||
let num_driving_fwd = if let Some(n) = osm_tags
|
||||
@ -77,13 +81,9 @@ pub fn get_lane_types(osm_tags: &BTreeMap<String, String>) -> (Vec<LaneType>, Ve
|
||||
};
|
||||
|
||||
// Sup West Seattle
|
||||
let driving_lane = if osm_tags.get("access") == Some(&"no".to_string())
|
||||
&& osm_tags.get("bus") == Some(&"yes".to_string())
|
||||
{
|
||||
let driving_lane = if tags.is("access", "no") && tags.is("bus", "yes") {
|
||||
LaneType::Bus
|
||||
} else if osm_tags.get("access") == Some(&"no".to_string())
|
||||
|| osm_tags.get("highway") == Some(&"construction".to_string())
|
||||
{
|
||||
} else if tags.is("access", "no") || tags.is("highway", "construction") {
|
||||
LaneType::Construction
|
||||
} else {
|
||||
LaneType::Driving
|
||||
@ -92,9 +92,7 @@ pub fn get_lane_types(osm_tags: &BTreeMap<String, String>) -> (Vec<LaneType>, Ve
|
||||
let mut fwd_side: Vec<LaneType> = iter::repeat(driving_lane).take(num_driving_fwd).collect();
|
||||
let mut back_side: Vec<LaneType> = iter::repeat(driving_lane).take(num_driving_back).collect();
|
||||
// TODO Fix upstream. https://wiki.openstreetmap.org/wiki/Key:centre_turn_lane
|
||||
if osm_tags.get("lanes:both_ways") == Some(&"1".to_string())
|
||||
|| osm_tags.get("centre_turn_lane") == Some(&"yes".to_string())
|
||||
{
|
||||
if tags.is("lanes:both_ways", "1") || tags.is("centre_turn_lane", "yes") {
|
||||
fwd_side.insert(0, LaneType::SharedLeftTurn);
|
||||
}
|
||||
|
||||
@ -113,24 +111,24 @@ pub fn get_lane_types(osm_tags: &BTreeMap<String, String>) -> (Vec<LaneType>, Ve
|
||||
}
|
||||
}
|
||||
|
||||
if osm_tags.get("cycleway") == Some(&"lane".to_string()) {
|
||||
if tags.is("cycleway", "lane") {
|
||||
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()) {
|
||||
if tags.is("cycleway:right", "lane") {
|
||||
fwd_side.push(LaneType::Biking);
|
||||
}
|
||||
if osm_tags.get("cycleway:left") == Some(&"lane".to_string())
|
||||
|| osm_tags.get("cycleway:left") == Some(&"opposite_lane".to_string())
|
||||
|| osm_tags.get("cycleway") == Some(&"opposite_lane".to_string())
|
||||
if tags.is("cycleway:left", "lane")
|
||||
|| tags.is("cycleway:left", "opposite_lane")
|
||||
|| tags.is("cycleway", "opposite_lane")
|
||||
{
|
||||
back_side.push(LaneType::Biking);
|
||||
}
|
||||
|
||||
// Cycleway isn't explicitly specified, but this is a reasonable assumption anyway.
|
||||
if back_side.is_empty() && osm_tags.get("oneway:bicycle") == Some(&"no".to_string()) {
|
||||
if back_side.is_empty() && tags.is("oneway:bicycle", "no") {
|
||||
back_side.push(LaneType::Biking);
|
||||
}
|
||||
}
|
||||
@ -154,20 +152,27 @@ pub fn get_lane_types(osm_tags: &BTreeMap<String, String>) -> (Vec<LaneType>, Ve
|
||||
}
|
||||
|
||||
// TODO Need to snap separate sidewalks to ways. Until then, just do this.
|
||||
if osm_tags.get(osm::SIDEWALK) == Some(&"both".to_string())
|
||||
|| osm_tags.get(osm::SIDEWALK) == Some(&"separate".to_string())
|
||||
{
|
||||
if tags.is(osm::SIDEWALK, "both") || tags.is(osm::SIDEWALK, "separate") {
|
||||
fwd_side.push(LaneType::Sidewalk);
|
||||
back_side.push(LaneType::Sidewalk);
|
||||
} else if osm_tags.get(osm::SIDEWALK) == Some(&"right".to_string()) {
|
||||
} else if tags.is(osm::SIDEWALK, "right") {
|
||||
fwd_side.push(LaneType::Sidewalk);
|
||||
} else if osm_tags.get(osm::SIDEWALK) == Some(&"left".to_string()) {
|
||||
} else if tags.is(osm::SIDEWALK, "left") {
|
||||
back_side.push(LaneType::Sidewalk);
|
||||
}
|
||||
|
||||
(fwd_side, back_side)
|
||||
}
|
||||
|
||||
// TODO Figure out Rust strings; there's maybe a less verbose way than the old
|
||||
// osm_tags.get("cycleway:right") == Some(&"lane".to_string()) mess.
|
||||
struct Tags<'a>(&'a BTreeMap<String, String>);
|
||||
impl<'a> Tags<'a> {
|
||||
fn is(&self, k: &str, v: &str) -> bool {
|
||||
self.0.get(k) == Some(&v.to_string())
|
||||
}
|
||||
}
|
||||
|
||||
// This is a convenient way for map_editor to plumb instructions here.
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct RoadSpec {
|
||||
|
Loading…
Reference in New Issue
Block a user