I have a problem to be solved with shortest path route.
What I have:
- layer 1 with startpoints
- layer 2 with endpoints
- layer 3 with streets (lines)
These two point layers are originally the start and endpoints of a layer of lines, but now i'm looking for an alternate route for these lines, using the shortest path algorithm.
I want to calculate the shortest path between these two point layers. The two pointlayers have both an attribute where the startpoint and endpoint have the same unique value, so they can be connected on that attribute value I suppose.
I already did a try with pgRouting: i followed a tutorial and already did pgr_createTopology on the streetlayer, so the vertices of these streets are already made.
But now i'm stuck, can for example pgr_dijkstra be automised for a whole layer? (because each pointlayer contains +10.000 points)
My idea was to use nearest neighbour to link the start and endpoints to a vertice of the streets. And then use pgr_dijkstra on that streetlayer so that the shortest path is calculated when the values of the pointlayer are the same, so startpoint(UNIQUE_VALUE) = endpoint(UNIQUE_VALUE).
How is this possible, or does someone have another solution?