a-b-street / osm2streets

Convert OSM to street networks with detailed geometry
https://a-b-street.github.io/osm2streets
Apache License 2.0
102 stars 10 forks source link

RuntimeError: unreachable executed when the underlying Rust crate panicked #221

Closed gisfromscratch closed 7 months ago

gisfromscratch commented 1 year ago

We could reproduce some panicking of the underlying Rust crate using a specific area of interest. The issue also arises when using the cli from a/b street.

Would you be so kind what causes the crash. Some common practices narrowing the data error down are needed. From a geospatial engineer perspective, we can easily validate and correct topology errors using our favorite geospatial tools. But, we don't know how to refer to the underlying OSM id by using the homebrewn "Road Ids" like "Road #704".

Here is the area of interest causing the crash: Area of Interest

[2023-08-05T17:41:27Z WARN osm2streets::road] named lane doesn't exist [2023-08-05T17:41:27Z ERROR streets_reader::split_ways] Skipping Road #704: PL with total length 50.2574m and 10 pts has dupe non-adjacent pts [2023-08-05T17:41:27Z ERROR streets_reader::split_ways] Skipping Road #860: PL with total length 54.0387m and 10 pts has dupe non-adjacent pts thread 'main' panicked at 'called Option::unwrap() on a None value', /home/runner/.cargo/git/checkouts/osm2streets-fbbbdf753e406749/aba1831/osm2streets/src/lanes/classic.rs:522:13 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace [2023-08-05T17:41:27Z ERROR abstutil::time] dropping Timer while doing progress split roads, due to panic?

dabreegster commented 1 year ago

Hi, thanks for reporting this bug! I've fixed it in the osm2streets web app. The problem is https://www.openstreetmap.org/way/148338681 has sidewalk:left:width, but there's no sidewalk=left or sidewalk=both tag. In this case, arguably sidewalk=left is implied by the presence of the other tags, but I'm not sure what tagging standards people are adopting.

osm2streets doesn't currently use tagged lane or sidewalk widths. The code I removed above was outdated and actually had no effect (a later apply_width call overwrote it). I've had #222 and #223 in mind for a long time, but haven't gotten to starting them yet. I did file issues to track.

I'll keep this issue open to track better error handling in this part of the code in general. You're right that the logged IDs aren't helpful. When lane parsing code fails, the error message should clearly state the OSM way that failed, at least

dabreegster commented 7 months ago

Seems to work fine now, including the sidewalk width parsing, thanks to the switch to https://gitlab.com/LeLuxNet/Muv/