Tuesday, 17 April 2018

pgrouting - pgr_dijkstra working but pgr_ksp but returning anything for the same params


The following returns a route as expected.


SELECT seq, id1 AS node, id2 AS edge, cost, b.the_geom as the_geom FROM pgr_dijkstra('

SELECT gid AS id,
source::integer,
target::integer,
length::double precision AS cost
FROM ways',
247542, 258349, false, false) a LEFT JOIN ways b ON (a.id2 = b.gid);

However the following does not. I expected this to return 3 routes but instead it returns nothing.


SELECT seq, id1 AS node, id2 AS edge, cost, b.the_geom as the_geom FROM pgr_ksp('
SELECT gid AS id,

source::integer,
target::integer,
length::double precision AS cost
FROM ways',
247542, 258349, 3, false) a LEFT JOIN ways b ON (a.id2 = b.gid);

Any idea why this is happening?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...