routing icon indicating copy to clipboard operation
routing copied to clipboard

Nearest neighbour (question)

Open bryanschoot opened this issue 4 years ago • 1 comments

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.

  • Orange dots are the poi;
  • Green line and text is the starting point
  • Red line and text is the nearest neighbor on the router network

Schermafbeelding 2021-06-08 205648

bryanschoot avatar Jun 08 '21 19:06 bryanschoot

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.

xivk avatar Jun 10 '21 07:06 xivk