This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

[closed] Distance Between Nodes

0

I want to implement the shortest path algorithm using the OSM data but i dont know how to get the distance between nodes(http://api.openstreetmap.org/api/0.6/map?bbox=11.54,48.14,11.543,48.145 in this file for example. where is the distance between nodes?)

how can i get the distance between nodes using the OSM data? i am newbie using the opensteetmap.

thanks in advance.

asked 27 Jan '14, 12:18

Kenji%20Gabriel's gravatar image

Kenji Gabriel
-1334
accept rate: 0%

closed 27 Jan '14, 12:34

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273

The question has been closed for the following reason “Question is off-topic or not relevant” by Frederik Ramm 27 Jan ‘14, 12:34


One Answer:

1

There are several very good routing engines for OpenStreetMap data already. The distance between two locations given in lat,lon coordinates on the Earth's surface is called the "Great Circle Distance" and can be computed using, among others, the so-called Haversine formula. This is not really an OpenStreetMap related question so I'm closing it.

answered 27 Jan '14, 12:34

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Just to add to that - this page of the beginners' guide explains a bit about the data in OSM (and in the file that you downloaded):

https://wiki.openstreetmap.org/wiki/Beginners_Guide_1.3

The distance been points isn't in the file, but their place on the surface of the earth is. In addition, bear in mind that you don't need to use an API call to obtain OSM data - just download one of the extracts linked from this page:

http://planet.openstreetmap.org/

(27 Jan '14, 12:42) SomeoneElse ♦

Source code available on GitHub .