# making a map and calculate a distance

 1 how to calculate a distance between two locations? asked 19 Jan '13, 16:06 Marco Schumann 16●1●1●2 accept rate: 0% 2 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? (20 Jan '13, 13:54) SomeoneElse ♦

 3 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 ♦ 74.8k●87●675●1155 accept rate: 24%
 2 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. ``````http://yournavigation.org/api/dev/route.php?flat=59.31934&flon=18.0572&tlat=58.4162&tlon=15.5523&v=motorcar&fast=1&instructions=1 http://router.project-osrm.org/viaroute?z=6&loc=59.3193,18.0572&loc=58.4162,15.5523&alt=false `````` it's very simple to extract the distance from these results. `````` OSRM: "route_summary":{"total_distance":199988 YOURS: 200.510334 `````` See OSRM server API for more info answered 24 Jan '13, 11:47 emj 2.0k●12●34●47 accept rate: 15%
 0 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 12.3k●79●132●269 accept rate: 4% 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
 toggle preview community wiki:

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Question tags:

×54

question asked: 19 Jan '13, 16:06

question was seen: 9,751 times

last updated: 19 Jun '13, 12:33