color roads under construction in unzoomed mode based on the underlying road type.
technically this affects stop sign placement, but not wort regenerating
maps yet.
@@ -344,12 +344,24 @@ impl Road {
// Used to determine which roads have stop signs when roads of different types intersect.
pub fn get_rank(&self) -> usize {
- if let Some(highway) = self.osm_tags.get(osm::HIGHWAY) {
- match highway.as_ref() {
+ let hwy = if let Some(x) = self.osm_tags.get(osm::HIGHWAY) {
+ if x == "construction" {
+ // What exactly is under construction?
+ if let Some(x) = self.osm_tags.get("construction") {
+ x
+ } else {
+ return 0;
+ }
+ } else {
+ x
+ }
+ } else {
+ return 0;
+ };
+
+ match hwy.as_ref() {
"motorway" => 20,
"motorway_link" => 19,
- // TODO Probably not true in general. For the West Seattle bridge.
- "construction" => 18,
"trunk" => 17,
"trunk_link" => 16,
@@ -377,12 +389,9 @@ impl Road {
// convert_osm/src/extract.rs's is_road().
_ => panic!(
"Unknown OSM highway {}. Other tags: {:?}",
- highway, self.osm_tags
+ hwy, self.osm_tags
),
}
- } else {
- 0
- }
}
pub fn all_bus_stops(&self, map: &Map) -> Vec<BusStopID> {
