how to calculate a distance between two locations? asked 19 Jan '13, 16:06 Marco Schumann |
This is not an OpenStreetMap specific question. In software, a formula called the Haversine formula is used to compute the distance between two points. You will likely find example implementations in your programming language of choice if you search for them on the web. answered 19 Jan '13, 16:48 Frederik Ramm ♦ |
You can use a router e.g. an online one like yournavigation or OSRM, of course these can only be used for small amount of lookups (see OSRM api policy), and they candisapear at any moment. If you want to lookup lots of these distances you will have to install something of your own, installing Gosmore is quite easy, OSRM I've never tried to install. These are the URLs to use.
it's very simple to extract the distance from these results.
See OSRM server API for more info answered 24 Jan '13, 11:47 emj |
If you need to calculate a distance often some mapping software will help. I have recently installed an OSM map into Garmin's Basecamp and Mapsource both, or either can be downloaded free. They are very similar and I'm not sure why both exist or which is best. They're good and are great for route planning and sending maps,way points and routes (plotted or auto routing) to my Garmins along roads or paths. answered 22 Jan '13, 10:14 andy mackey sorry mapsource may not work without a garmin device but basecamp will, I think, http://www8.garmin.com/support/download_details.jsp?id=4435
(22 Jan '13, 10:24)
andy mackey
wiki.openstreetmap.org/wiki/BaseCamp
(22 Jan '13, 10:28)
andy mackey
|
A bit more information about what you're trying to do here would help.
Do you want the great circle distance between two locations on the earth's surface, or the travel distance from one to another calculated by a router for a particular mode of transport?