diff --git a/convert_osm/src/osm.rs b/convert_osm/src/osm.rs index 9c6398781f..401a0b30f4 100644 --- a/convert_osm/src/osm.rs +++ b/convert_osm/src/osm.rs @@ -75,7 +75,8 @@ pub fn extract_osm( continue; } let pts = map.gps_bounds.forcibly_convert(&gps_pts); - let tags = tags_to_map(&way.tags); + let mut tags = tags_to_map(&way.tags); + tags.insert("abst:osm_way_id".to_string(), way.id.to_string()); if is_road(&tags) { roads.push(raw_data::Road { osm_way_id: way.id, @@ -126,7 +127,8 @@ pub fn extract_osm( timer.start_iter("processing OSM relations", doc.relations.len()); for rel in doc.relations.values() { timer.next(); - let tags = tags_to_map(&rel.tags); + let mut tags = tags_to_map(&rel.tags); + tags.insert("abst:osm_rel_id".to_string(), rel.id.to_string()); if let Some(at) = get_area_type(&tags) { if tags.get("type") == Some(&"multipolygon".to_string()) { let mut ok = true; diff --git a/game/src/debug/mod.rs b/game/src/debug/mod.rs index a13f24fce1..ee4d6cb4dd 100644 --- a/game/src/debug/mod.rs +++ b/game/src/debug/mod.rs @@ -462,7 +462,6 @@ fn search_osm(wiz: &mut Wizard, ctx: &mut EventCtx, ui: &mut UI) -> Option Option Text { Line(format!("{} is ", l.id)), Line(r.get_name()).fg(Color::CYAN), ]); - txt.add(Line(format!("From OSM way {}", r.osm_way_id))); txt.add(Line(format!( "Parent {} (originally {}) points to {}", r.id, r.stable_id, r.dst_i @@ -216,10 +215,7 @@ fn tooltip_lines(id: ID, g: &mut GfxCtx, ctx: &PerMapUI) -> Text { } ID::Building(id) => { let b = map.get_b(id); - txt.add(Line(format!( - "Building #{:?} (from OSM way {})", - id, b.osm_way_id - ))); + txt.add(Line(format!("Building #{:?}", id))); txt.add(Line(format!( "Dist along sidewalk: {}", b.front_path.sidewalk.dist_along() @@ -252,7 +248,7 @@ fn tooltip_lines(id: ID, g: &mut GfxCtx, ctx: &PerMapUI) -> Text { } ID::Area(id) => { let a = map.get_a(id); - txt.add(Line(format!("{} (from OSM {})", id, a.osm_id))); + txt.add(Line(format!("{}", id))); styled_kv(&mut txt, &a.osm_tags); } ID::Trip(_) => {} diff --git a/synthetic/src/model.rs b/synthetic/src/model.rs index c86358a983..8c963afabe 100644 --- a/synthetic/src/model.rs +++ b/synthetic/src/model.rs @@ -313,6 +313,10 @@ impl Model { ); osm_tags.insert("abst:endpt_fwd".to_string(), "true".to_string()); osm_tags.insert("abst:endpt_back".to_string(), "true".to_string()); + osm_tags.insert( + "abst:osm_way_id".to_string(), + SYNTHETIC_OSM_WAY_ID.to_string(), + ); let center_points = vec![ self.map.intersections[&i1].point, self.map.intersections[&i2].point, @@ -423,11 +427,8 @@ impl Model { self.map.roads[&id].get_spec().to_string() } - pub fn get_tags(&self, id: StableRoadID) -> BTreeMap { - let r = &self.map.roads[&id]; - let mut tags = r.osm_tags.clone(); - tags.insert("abst:osm_way_id".to_string(), r.osm_way_id.to_string()); - tags + pub fn get_tags(&self, id: StableRoadID) -> &BTreeMap { + &self.map.roads[&id].osm_tags } fn lanes(&self, id: StableRoadID) -> Vec> {