import railway=rail as light rail track. nothing should really use it, but it helps visually recognize areas with lots of notable railways. railways under construction not included yet, so some of the lines in krakow just sort of end.

not regenerating maps yet
This commit is contained in:
Dustin Carlino 2020-07-22 11:35:04 -07:00
parent d2e8dc95d1
commit 404b6e589b
3 changed files with 10 additions and 3 deletions

View File

@ -417,9 +417,11 @@ fn tags_to_map(raw_tags: &[osm_xml::Tag]) -> Tags {
}
fn is_road(tags: &mut Tags) -> bool {
if tags.is("railway", "light_rail") {
if tags.is_any("railway", vec!["light_rail", "rail"]) {
return true;
}
// TODO Because trams overlap with roads, they're harder:
// https://github.com/dabreegster/abstreet/issues/141
if tags.is("railway", "tram") {
return false;
}

View File

@ -18,7 +18,7 @@ pub fn get_lane_types(osm_tags: &BTreeMap<String, String>) -> (Vec<LaneType>, Ve
}
// Easy special cases first.
if tags.is("railway", "light_rail") {
if tags.is_any("railway", vec!["light_rail", "rail"]) {
return (vec![LaneType::LightRail], Vec::new());
}
if tags.is(osm::HIGHWAY, "footway") {

View File

@ -344,8 +344,13 @@ impl RawRoad {
self.osm_tags.get(osm::SYNTHETIC) == Some(&"true".to_string())
}
// TODO For the moment, treating all rail things as light rail
pub fn is_light_rail(&self) -> bool {
self.osm_tags.get("railway") == Some(&"light_rail".to_string())
if let Some(v) = self.osm_tags.get("railway") {
vec!["light_rail", "rail"].contains(&v.as_ref())
} else {
false
}
}
pub fn is_footway(&self) -> bool {