Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I need a tool to find the distance between two points whose longitude and latitude are given. I am making an application so it will require bulk queries, so i cannot use google maps distance matrix API that could tell me the distance via road, airways or any other. So I turned up to OSM data, i downloaded the OSM data and then pgrouting tool. But I am unable to find the distance via road between two points from this data stored in postgres table.

Any help regarding how to fetch this data from the postgresql db or any other resource you know that can accomplish my goal will be greatly appreciated.

share|improve this question
    
pgRouting requires each road entry to have a start and an end node id. If your dataset already contains this information, you can skip this step. Otherwise we will create the node ids now - underdark.wordpress.com/2011/02/07/… credit to @underdark –  Mapperz Jun 19 '12 at 21:11
    
CAn you project the point to the nearest line and use the projection for mapping? –  dassouki Aug 30 '12 at 23:38

2 Answers 2

OSM has a page dedicated to routing, which is worth going over:

http://wiki.openstreetmap.org/wiki/Routing

There is a special tool for importing OSM data into a PGRouting system and generating the required structure:

https://github.com/pgRouting/osm2pgrouting

Lastly, there is a workshop tutorial on getting routing working with OSM data here:

http://workshop.pgrouting.org/index.html

share|improve this answer

You can use GraphHopper for this task. Have a look into the documentation for more information.

share|improve this answer

Your Answer

 
discard

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.