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
33 stars 2 forks source link

Website cannot differentiate nearby ways #183

Closed droogmic closed 2 years ago

droogmic commented 2 years ago

If ways are close together, e.g. a road and an adjacent cyclepath, one may not be selectable.

This is because overpass returns the ways within 10m in no particular order: https://github.com/a-b-street/osm2lanes/blob/main/osm2lanes/src/overpass.rs#L146

As far as I know, there is no overpass API to do what we want (find the nearest), so we may need to do a linear search of all line segments in the geometries of all returned ways to find which one is the closest to the queried point.