itinero / routing

The routing core of itinero.
Apache License 2.0
220 stars 70 forks source link

Nearest neighbour (question) #341

Open bryanschoot opened 3 years ago

bryanschoot commented 3 years ago

When the routerDb is created and multiple poi are resolved onto the edges is it possible to find the nearest neighbour of a certain lng lat position.

The image below is an example of what I mean.

Schermafbeelding 2021-06-08 205648

xivk commented 3 years ago

If I understand correctly you could calculate one-to-many with all the given points as targets.

It's also possible to let Itinero stop at the first location it finds, that's quite a bit of custom code, but very possible.

Have a look at how the many-to-many code works as a starting point. Basically, you could use a Dijkstra search starting at the starting point and have it stop at the first location it finds.