I have a road network and I used pgr_createTopology and pgr_nodeNetwork to convert it for use in pgRouting library. However the results are fragmented and there is no continuous path. Furthermore I have to give source and target values instead of ID in the below query. here 747 and 311 are source and target values from table rather than IDs.

pgr_dijkstra(' SELECT id, source::int, target::int, length::double precision AS cost FROM guru_noded', 747, 311, false, false);

I am new to this.


Probabaly your "snapping tolerance" parameter did not match with the unit of your data, when you ran pgr_createTopology.

The dimension of the tolerance parameter depends on your data projection. Usually it’s either “degrees” or “meters”.

  • Are u saying that if I have my data in wgs84 lat long coordinate system, and run pgr_createtopology with tolerance parameter value 0.001, then 0.001 will be considered as degrees instead of meters? – Hilal Al-Rajhi Oct 27 '20 at 18:35
  • Yes, this is correct. The snapping value is in the unit of your projection. – dkastl Nov 13 '20 at 12:27

have you tried another solution?

If you just want to calculate the faster or shorter path, just use the network analysis tool from QGIS


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.