[pgrouting-users] Dijkstra algorithm

Alexander Logvinov avl at logvinov.com
Wed Nov 11 09:22:52 EST 2009


Hello!

Sorry for the late response. I had some problems with Internet access.

On 09.11.2009 17:17 Anton Patrushev wrote:
> Welcome to the community!
 Thanks! And thanks for the interesting project!

> It is nice to know that somebody in Russia is using pgRouting.
 Just starting to use it. :) I've created FreeBSD port for pgRouting and
will add it to the official FreeBSD ports tree if you don't mind.

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

> 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, 
 Right.

> in your case (meters?) the value should be much higher,
> something like 5 or 10.
 Yep, now it's in the Google Mercator projection.

> 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;
 Sorry for the stupid question. How can I guess the value according
results of this query?

> By the way, I tried this query with your data and I got bizarre
> numbers like 14196158.0571046, 6463888.3288762. Is it in millimetres?
 Hm, they should be in meters.

> 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.
 I've tried to change snapping value from 700 to 1200. Here is results
with 1000 value: http://www.logvinov.ru/files/pg/route.png .

Best regards,
Alexander




More information about the Pgrouting-users mailing list