preserve OSM tags when merging degenerate intersections. this lets 24th and lake washington be fixed without messing up the z-layering

This commit is contained in:
Dustin Carlino 2019-06-26 17:20:20 -07:00
parent d08c794cfe
commit 5e1a7238e8
4 changed files with 32 additions and 2 deletions

View File

@ -315,6 +315,22 @@
"latitude": 47.6252204 "latitude": 47.6252204
} }
} }
},
{
"MergeDegenerateIntersection": {
"point": {
"longitude": -122.3020493,
"latitude": 47.6442086
}
}
},
{
"MergeDegenerateIntersection": {
"point": {
"longitude": -122.3020349,
"latitude": 47.6447682
}
}
} }
] ]
} }

View File

@ -67,6 +67,7 @@ impl State for SplashScreen {
fn on_suspend(&mut self, _: &mut UI) { fn on_suspend(&mut self, _: &mut UI) {
self.wizard.reset(); self.wizard.reset();
self.maybe_screensaver = None;
} }
} }

View File

@ -74,7 +74,7 @@ pub fn make_half_map(
let mut road = Road { let mut road = Road {
id: road_id, id: road_id,
osm_tags: raw_r.osm_tags.clone(), osm_tags: r.osm_tags.clone(),
osm_way_id: raw_r.osm_way_id, osm_way_id: raw_r.osm_way_id,
stable_id: r.id, stable_id: r.id,
children_forwards: Vec::new(), children_forwards: Vec::new(),

View File

@ -27,6 +27,8 @@ pub struct Road {
pub fwd_width: Distance, pub fwd_width: Distance,
pub back_width: Distance, pub back_width: Distance,
pub lane_specs: Vec<lane_specs::LaneSpec>, pub lane_specs: Vec<lane_specs::LaneSpec>,
// Copied here from the raw layer, because merge_degenerate_intersection needs to modify them.
pub osm_tags: BTreeMap<String, String>,
} }
impl Road { impl Road {
@ -130,6 +132,7 @@ impl InitialMap {
fwd_width, fwd_width,
back_width, back_width,
lane_specs, lane_specs,
osm_tags: r.osm_tags.clone(),
}, },
); );
} }
@ -224,7 +227,7 @@ impl InitialMap {
r.trimmed_center_pts = r.original_center_pts.clone(); r.trimmed_center_pts = r.original_center_pts.clone();
} }
// And finally the intersection geometry // Redo the intersection geometry.
{ {
let i = self.intersections.get_mut(&new_i1).unwrap(); let i = self.intersections.get_mut(&new_i1).unwrap();
i.polygon = geometry::intersection_polygon(i, &mut self.roads, timer); i.polygon = geometry::intersection_polygon(i, &mut self.roads, timer);
@ -233,6 +236,16 @@ impl InitialMap {
let i = self.intersections.get_mut(&new_i2).unwrap(); let i = self.intersections.get_mut(&new_i2).unwrap();
i.polygon = geometry::intersection_polygon(i, &mut self.roads, timer); i.polygon = geometry::intersection_polygon(i, &mut self.roads, timer);
} }
// Preserve some OSM tags.
{
let r = self.roads.get_mut(&r2).unwrap();
for (k, v) in deleted_road.osm_tags {
if !r.osm_tags.contains_key(&k) {
r.osm_tags.insert(k, v);
}
}
}
} }
pub fn apply_hints(&mut self, hints: &Hints, raw: &raw_data::Map, timer: &mut Timer) { pub fn apply_hints(&mut self, hints: &Hints, raw: &raw_data::Map, timer: &mut Timer) {