I have an an certain area contains less than 200 roads(polylines), and I need to calculate a shortest path between two specified points inside the area.

I know maybe I can use the pgroute in postgis to do the calculation, however I wonder if there is an alternative to use common database like mysql instead of spatial database since the dataset is not large enough?

  • I don't think MySQL supports shortest-path algorithms. However, it is pretty straightforward to implement Djikstra's algorithm, here is a Python solution, if you want to avoid pgrouting. Jun 1, 2015 at 14:03
  • 1
    How are you storing polylines without a spatial database? Why use the postgis tag if you wish a mysql solution?
    – Martin F
    Jun 2, 2015 at 4:11

1 Answer 1


If you load your data into qgis you can find the shortest path with this plugin: http://docs.qgis.org/1.8/en/docs/user_manual/plugins/plugins_road_graph.html

I don't know what is your source dataset, but into qgis you can import many of different gis file formats and also you can connect to spatial databases.

Your Answer

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

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