Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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. – Deer Hunter Mar 20 '13 at 7:10
You will need pgrouting/postgis to do this in QGIS see Devdatta Tengshe's answer. – Mapperz Mar 20 '13 at 14:21
up vote 1 down vote accepted

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.

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

share|improve this answer
I am using QuantumGiS and Postgresql till now – Gurucharan Vijayakumar Mar 20 '13 at 6:30
Google Earth Pro is Simple work, Thanks for referring this , Thank you once again .. – Gurucharan Vijayakumar Mar 21 '13 at 12:56

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.

share|improve this answer
Thanks sir ! I had already involved in pgrouting ... – Gurucharan Vijayakumar Mar 21 '13 at 12:57

QGIS 2.0 contains all the functionality necessary to calculate shortest paths. The API is documented here:

I've created a Processing script for the use case of routing between consecutive points:

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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