[pgrouting-users] Dijkstra algorithm

Anton Patrushev anton at orkney.co.jp
Mon Nov 9 04:17:18 EST 2009


Hi Alexander,

Welcome to the community!
It is nice to know that somebody in Russia is using pgRouting.

OK, you problem is here
> blg=# SELECT assign_vertex_id('blg_street_line', 0.001, 'the_geom', 'gid');

The second parameter is snapping distance in your projection units. It
snaps vertices within this distance to one.
I guess you copied it from the example where we used a projection in
degrees, in your case (meters?) the value should be much higher,
something like 5 or 10.


You can try to guess the value executing the following query:

select gid x(startpoint(the_geom)), y(startpoint(the_geom)),
x(endpoint(the_geom)), y(endpoint(the_geom)) from blg_street_line
order by source;

By the way, I tried this query with your data and I got bizarre
numbers like 14196158.0571046, 6463888.3288762. Is it in millimetres?
Then I tried this

SELECT assign_vertex_id('blg_street_line', 1000, 'the_geom', 'gid');

and I could route through the network, but I am not quite sure if I
snapped vertices correctly, because points  14196158.0571046,
6463888.3288762 and 14196478.1254662, 6463261.07520014 became one. OK,
the snapping value is up to you.

Cheers!
Anton.



More information about the Pgrouting-users mailing list