[pgrouting-users] Function to result routes/costs from single_origin to multi-destinations

AUS - Eyad b00038807 at aus.edu
Sun Nov 9 10:42:20 PST 2014

While applying the following tutorial:
d-qgis/ utilizing vector network which has been tested (and demonstrated
functionality) for shortest path application, it returned the following

Query returned successfully: 1013 rows affected, 199 ms execution time

but returned no table as output!

The code I used is:

create table catchment_1 as select id, the_geom, (select sum(cost) from (
SELECT * FROM pgr_dijkstra( 'SELECT id, source, target, st_length(geom) as
cost FROM schema.cvl', 1, 320, false, false )) as foo ) as cost from

I also tried passing "id" to the function instead of "320" as per the
tutorial but got the following msg:

ERROR: function pgr_dijkstra(unknown, integer, bigint, boolean, boolean)
does not exist SQL state: 42883

Although, pgr_dijkstra is working well with other codes.. so, it's one of
the recognized functions in my installed pgRouting layer

I'm using QGIS 2.0.1 and pgRouting pg93-binaries-2.4.0


In order to gradually test the code, I started by the inner SELECT then went
up step by step.. I got result table for each step until I reached the
highest SELECT in the structure.. I got a table showing the cost for each
point_id. the special result is a point feature.. but what drew my attention
in the result table is that all costs are exactly the same '32430.028'
whereas the points are non-regularly distributed.. This means that I just
needed to remove 'create table catchment_1 as' to get a result table, but
still the cost values do not seem to make sense.


LAST COMMENT.. If you know another code/method that helps in multi-routing
from one point to list of targets to result routes and costs from
single-origin (source) to multi-destinations (targets), please provide
guidance.. origins and destinations are in a single points feature (i.e.
cvl_vertices_pgr), whereas routes calculation shall take place in lines
feature (i.e. cvl).




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20141109/e8ea7081/attachment.html>

More information about the Pgrouting-users mailing list