Hi,
I am using function pgr_dijkstra from pgrouting on a shape file I have attached here.
The table from the shape file has following columns: gid, geom, start_id, end_id, length
When I run the following code:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra(’
SELECT gid AS id,
start_id::integer AS source,
end_id::integer AS target,
length AS cost
FROM wp_norway_network’,
1,100, false, false);
I am getting results with seq, node, edge and cost. But the values for the edge column has eight digit values which is not listed in my table. Is not it supposed to be the gid values of my table has to be given in the edge column?
You can also run the graph analysis and node network on your data and see if that fixes things. Typically data from OSM is not noded correctly and needs to be noded to work with pgRouting.
-Steve
On 11/17/2013 12:03 AM, Kaja wrote:
Hi,
I am using function pgr_dijkstra from pgrouting on a shape file I have
attached here.
The table from the shape file has following columns: gid, geom,
start_id, end_id, length
When I run the following code:
SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra('
SELECT gid AS id,
start_id::integer AS source,
end_id::integer AS target,
length AS cost
FROM wp_norway_network',
1,100, false, false);
I am getting results with seq, node, edge and cost. But the values for
the edge column has eight digit values which is not listed in my table.
Is not it supposed to be the gid values of my table has to be given in
the edge column?
Thanks for your reply. I have renamed the columns to the_geom, id, source and
target and then executed 'pgr_createTopology'. After that used
'pgr_analyzeGraph'. The output is 'OK'. But the edge ids are not the ids
from the table. So still the problem is there.