[pgrouting-users] Driving Distance calculation documentation
questions
Stephen Woodbridge
woodbri at swoodbridge.com
Wed May 26 10:37:28 EDT 2010
Hi all,
I'm trying to map my knowledge of Driving Distance to the pgRouting
function:
CREATE OR REPLACE FUNCTION driving_distance(sql text, source_id integer,
distance float8, directed boolean, has_reverse_cost boolean)
RETURNS SETOF path_result
So my assumptions (which may be invalid) are that this function does a
Dijkstra search start at source_id with a search cutoff at distance. And
that the result somehow represents the resulting Dijkstra tree.
If that is correct then I would expect to have a list of nodes in the
tree, with the minimal cost to get from the source_id to that node. And
I would expect to have multiple terminal nodes that represent the outer
fringe of the search area.
So reading the documentation at:
http://pgrouting.postlbs.org/wiki/DrivingDistance
We get back set of result_path which. Questions:
1) vertex_id: the identifier of source vertex of each edge.
Is this literally the "source" node of the edge or the source given the
direction of traversal of the edge?
2) cost: It is 0 for the row after the last edge. Thus, the path total
cost can be computed using a sum of all rows in the cost column.
This appears to assume a single path and not a tree of all paths out
from source_id to the cutoff distance. How does one compute the cost to
get to any given node in the result set.
Could someone review this doc and maybe update the doc to clarify some
of this questions or discuss them here and I can update the doc if needed.
Thanks,
-Steve
More information about the Pgrouting-users
mailing list