How to find n nearest OSM nodes of a specific type "along" a route?

Thanks.

My thinking is: In the end, both types of searches are fundamentally only about visiting nodes/edges and storing cost information about them. And I’m expecting that the shortest (or rather: “cheapest”) path search will already visit several nodes/edges that I would need to also visit in my “waste bucket search”.

So for example: Assuming the “classic” path search algorithm is a Dijkstra.

Assume it “happens” to visit a “waste basket edge” (i.e. an edge that was identified to be closest to a waste basket). Then I could already remember a “candidate path” from the start node to the waste basket. And when the Dijkstra search is complete in the end, I could check if the final path has an edge that is also part of all the found “waste bucket candidate paths”. If they do, I could already get some kind of indication what detours must be rather cheap from the candidate path.

But maybe you’re right and this is not thought through enough yet. I’ll hopefully start implementing a prototype soon - maybe I can then report about my lessons learned.

1 Like