2

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.

2 Answers 2

3

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”.

2
  • 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? Commented Oct 27, 2020 at 18:35
  • Yes, this is correct. The snapping value is in the unit of your projection.
    – dkastl
    Commented Nov 13, 2020 at 12:27
0

have you tried another solution?

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

http://docs.qgis.org/2.2/pt_PT/docs/training_manual/vector_analysis/network_analysis.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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