4

I have used this great tutorial, and shortest part between two points works fine. My question is: How to calculate shortest path between multiple points?

nmtoken
  • 13,355
  • 5
  • 38
  • 87
Marko
  • 139
  • 1
  • 5

2 Answers2

5

there is a modified shortest_path which enables multiple destinations;

Take a look at https://github.com/pgRouting/pgrouting/wiki/One_to_many-Dijkstra---To-review or the forked pgrouting https://github.com/HSylvio/pgrouting

Hope it works as well for you as it does for me!

Aname
  • 343
  • 1
  • 8
1

Assuming you have multiple start points and a single finish point, another approach may be using Cost Path command in Raster Calculator as follows:

CostPath("Inicial_points","Costs","Direction")

Comparing paths with rivers, we can use "Inicial_points" = Headwaters, "Costs" = Digital Elevation Model and "Direction" = Flow Direction.

Werisk_
  • 143
  • 9