mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-29 01:13:53 +03:00
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:
parent
d2e8dc95d1
commit
404b6e589b
@ -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;
|
||||
}
|
||||
|
@ -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") {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user