data (#23) - Random results (#304) - Message List

Random results

I followed the tutorial for compiling pgrouting and preparing data for Dijkstra's shortest route. I used NavTeq?-streets for roads, adding my own integer row_id field as primary key (to use as GID)

The source and target columns resulting from assign_vertex_id('streets',0.001,'geom','row_id'); seem to nicely chain together the road from my house to my friends.

But the result from shortest_path('select row_id as id, source,target,length as cost from streets',476961,476671,false,false) results in 21 apparently random segments from my village (476961 the row_id from my street, 476671 the row_id from my friends).

Anyone a clue?

Thanks for reading, Martin

  • Message #1120

    Hi Martin,

    For Dijkstra shortest path function you should use vertex ids (source or target), not edge (row) ids.

    Anton.

    • Message #1186

      Thanks, I just did my first routing.

      Sorry for my late reply. Some projects kept me from using friday afternoon for R&D.

      Martin

      • Message #1191

        Hooray!