Closed droogmic closed 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.
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.