From e4ef6e4dd4830f40bfe39db268be58fb45e5c2a6 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 21 Jul 2023 12:17:39 +0100 Subject: [PATCH] Improve error message when importing happens to hit an odd boundary. [rebuild] [release] --- map_model/src/make/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/map_model/src/make/mod.rs b/map_model/src/make/mod.rs index d894b1bdaf..162c257d03 100644 --- a/map_model/src/make/mod.rs +++ b/map_model/src/make/mod.rs @@ -207,9 +207,15 @@ impl Map { for i in map.intersections.iter_mut() { if i.is_border() && i.roads.len() != 1 { + // i.orig_id may be synthetic and useless, so also print OSM links of the roads + let border_roads = i + .roads + .iter() + .map(|r| map.roads[r.0].orig_id.osm_way_id.to_string()) + .collect::>(); panic!( "{} ({}) is a border, but is connected to >1 road: {:?}", - i.id, i.orig_id, i.roads + i.id, i.orig_id, border_roads ); } if i.control == IntersectionControl::Signalled {