a-b-street / osm2lanes

A common library and set of test cases for transforming OSM tags to lane specifications
https://a-b-street.github.io/osm2lanes/
Apache License 2.0
34 stars 2 forks source link

attempt to subtract with overflow #152

Closed dabreegster closed 2 years ago

dabreegster commented 2 years ago

cargo run way 240294912 https://www.openstreetmap.org/way/240294912

osm2lanes/src/transform/tags_to_lanes/lane.rs:205:33

droogmic commented 2 years ago

lanes:both_ways=2, an odd one for sure, I don't even know what that means.

dabreegster commented 2 years ago

I think it's just a typo. https://wiki.openstreetmap.org/wiki/Key:lanes:both%20ways?uselang=en doesn't mention any other values. By and large, 1 is the value used https://taginfo.openstreetmap.org/keys/lanes%3Aboth_ways#values.

Should we 1) Throw an error 2) Assume any value besides "1" is a typo for "1" and emit a warning? 3) Assume any value besides "1" is a typo and not add anything?

I'll start with option 1 and at least not panic.

droogmic commented 2 years ago

My PR now implements the 3rd option, warning and ignore any value that isn't 1.

On Sat, 30 Apr 2022, 17:34 Dustin Carlino, @.***> wrote:

I think it's just a typo. https://wiki.openstreetmap.org/wiki/Key:lanes:both%20ways?uselang=en doesn't mention any other values. By and large, 1 is the value used https://taginfo.openstreetmap.org/keys/lanes%3Aboth_ways#values.

Should we

  1. Throw an error
  2. Assume any value besides "1" is a typo for "1" and emit a warning?
  3. Assume any value besides "1" is a typo and not add anything?

I'll start with option 1 and at least not panic.

— Reply to this email directly, view it on GitHub https://github.com/a-b-street/osm2lanes/issues/152#issuecomment-1114007324, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEL2Z2LWZHNQMBRGCUTQI3VHVHHJANCNFSM5UQLKMVA . You are receiving this because you commented.Message ID: @.***>

dabreegster commented 2 years ago

Awesome, thank you! I'll add a test for this