[pgrouting-users] Edge column in pgr_dijkstra

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?

I have attached the files as well. You can see the screenshot of my tables here:
http://gis.stackexchange.com/questions/77465/edge-column-in-pgr-dijkstra/

wp_norway_network_test.dbf (104 KB)

wp_norway_network_test.prj (143 Bytes)

wp_norway_network_test.qpj (257 Bytes)

wp_norway_network_test.shp (138 KB)

wp_norway_network_test.shx (12.6 KB)

The files I have attached in the previous mail might not be accessible. So I
have uploaded here and the link is :
http://www.4shared.com/folder/-8uxGG4b/_online.html

--
View this message in context: http://pgrouting-users.974093.n3.nabble.com/pgrouting-users-Edge-column-in-pgr-dijkstra-tp4025368p4025370.html
Sent from the pgRouting-users mailing list archive at Nabble.com.

Thanks Kaja,

I have the files that you attached.
I'll look at them when I get a chance.

You might want to read:
http://imaptools.com:8081/pgr2-doc/2.0/en/doc/src/tutorial/topology.html#topology

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?

I have attached the files as well. You can see the screenshot of my
tables here:
http://gis.stackexchange.com/questions/77465/edge-column-in-pgr-dijkstra/

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users

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.

--
View this message in context: http://pgrouting-users.974093.n3.nabble.com/pgrouting-users-Edge-column-in-pgr-dijkstra-tp4025368p4025373.html
Sent from the pgRouting-users mailing list archive at Nabble.com.

I finally solved the problem. In my query presently I have

'SELECT gid AS id'

changing that to

'SELECT gid::integer AS id' solved the issue.
Thanks for your time though.

--
View this message in context: http://pgrouting-users.974093.n3.nabble.com/pgrouting-users-Edge-column-in-pgr-dijkstra-tp4025368p4025390.html
Sent from the pgRouting-users mailing list archive at Nabble.com.