mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-26 07:52:05 +03:00
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:
parent
d08c794cfe
commit
5e1a7238e8
@ -315,6 +315,22 @@
|
||||
"latitude": 47.6252204
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"MergeDegenerateIntersection": {
|
||||
"point": {
|
||||
"longitude": -122.3020493,
|
||||
"latitude": 47.6442086
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"MergeDegenerateIntersection": {
|
||||
"point": {
|
||||
"longitude": -122.3020349,
|
||||
"latitude": 47.6447682
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -67,6 +67,7 @@ impl State for SplashScreen {
|
||||
|
||||
fn on_suspend(&mut self, _: &mut UI) {
|
||||
self.wizard.reset();
|
||||
self.maybe_screensaver = None;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ pub fn make_half_map(
|
||||
|
||||
let mut road = Road {
|
||||
id: road_id,
|
||||
osm_tags: raw_r.osm_tags.clone(),
|
||||
osm_tags: r.osm_tags.clone(),
|
||||
osm_way_id: raw_r.osm_way_id,
|
||||
stable_id: r.id,
|
||||
children_forwards: Vec::new(),
|
||||
|
@ -27,6 +27,8 @@ pub struct Road {
|
||||
pub fwd_width: Distance,
|
||||
pub back_width: Distance,
|
||||
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 {
|
||||
@ -130,6 +132,7 @@ impl InitialMap {
|
||||
fwd_width,
|
||||
back_width,
|
||||
lane_specs,
|
||||
osm_tags: r.osm_tags.clone(),
|
||||
},
|
||||
);
|
||||
}
|
||||
@ -224,7 +227,7 @@ impl InitialMap {
|
||||
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();
|
||||
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();
|
||||
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) {
|
||||
|
Loading…
Reference in New Issue
Block a user