Reputation: 3118
I have a graph represented in my database. I am sure that it is topologically correct, here is a small section of it, visualized in QGIS:
I want to et all the edges that are upstream from node 2132557864.
So I specify the query like this:
SELECT * FROM pgr_kruskalDFS(
'SELECT id, source_node_id as source, target_node_id as target,
-1 AS cost, st_length(geom) AS reverse_cost
from osm_edges',
3577226615)
According to the docs:
- It’s implementation is only on undirected graph.
- Process is done only on edges with positive costs.
So I guess this means that you can simulate a directed graph by passing -1
to cost
or reverse_cost
. I did this, but it still ends up returning the whole graph (at least, the parts that are not totally isolated):
What am I doing wrong here? It seems like this should be the correct way to get upstream edges from a node.
Upvotes: 0
Views: 8