Closed dabreegster closed 2 years ago
Feel free anyone to review asynchronously. To avoid PRs in a few repos stacked on each other and to make progress on the original bug I was working on (yak-shaving is fun when it's this easy and beneficial!), I'm going to merge now
Part of https://github.com/a-b-street/osm2streets/issues/80. Today we require the user to specify the driving side, or we attempt to query it from Overpass (but that seems to be flaky). It's much simpler to just see if some point within an imported area is within the polygon of a left-sided country or not.
See README.md for data sources and inspiration. I've got this tested end-to-end in osm2streets; a PR for that will be coming momentarily. I think we can later cleanup more things in osm2lanes based on this.
I'd like to later split out
driving-side
into its own repo and put it on crates.io, since it's of standalone value. But first I'd generalize it and return the ISO country code, not just left/right driving side -- aka, make a Rust port of https://github.com/westnordost/countryboundaries. I'd also add benchmarks and try out some optimizations. But for now,driving-side
is fast enough and has immediate massive value to osm2streets and A/B Street.