I am having shapefiles for a particular map location, the shapefile consists of points and polylines. Now I want to find the shortest path between the points. What is perfect and simple method to find shortest path.

  • You have not specified restrictions (do you want obstacle avoidance? Do you want smooth turns? etc. etc.) Look up Delaunay triangulations/Voronoi diagrams, A* algorithm and its derivatives. One of the approaches is based on transforming the shapefile into a graph and running a modification of A* on it. Commented Mar 20, 2013 at 7:10
  • 2
    You will need pgrouting/postgis to do this in QGIS see Devdatta Tengshe's answer.
    – Mapperz
    Commented Mar 20, 2013 at 14:21

3 Answers 3


If you are looking for a OpenSource Solution, you need to look at pgRouting.

You can upload your shapefiles in to postgis, and then run pgrouting on it.

To get started with pgRouting, I would suggest this workshop.


QGIS 2.0 contains all the functionality necessary to calculate shortest paths. The API is documented here: http://documentation.qgis.org/2.0/en/docs/pyqgis_developer_cookbook/network_analysis.html

I've created a Processing script for the use case of routing between consecutive points: http://anitagraser.com/2013/10/19/a-routing-script-for-the-processing-toolbox/

enter image description here


Since you have not mentioned what tool you are working in, here goes my suggestion.

I have just started my work on the similar task and Network Analyst (ArcGIS) gives you good results in what you are looking for. Try this out. http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Network_Analyst_Tutorial

You can also load your shapefile to google earth pro and carry out your task.

  • I am using QuantumGiS and Postgresql till now Commented Mar 20, 2013 at 6:30
  • Google Earth Pro is Simple work, Thanks for referring this , Thank you once again .. Commented Mar 21, 2013 at 12:56

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.