Answers to: Calculating the distance (length) of an OSM Wayhttps://help.openstreetmap.org/questions/19799/calculating-the-distance-length-of-an-osm-way<p>The title pretty much says it all. Is there an accurate method to calculate the distance of an OSM way?</p>enMon, 11 Feb 2013 12:29:37 +0000Answer by stephan75https://help.openstreetmap.org/questions/19799/calculating-the-distance-length-of-an-osm-way/19822<p>Everything about routing or similar aims based on OSM data is collected in the OSM wiki about <a href="http://wiki.openstreetmap.org/wiki/Routing">Routing</a>.</p>
<p>Search for opensource solutions to implement something in your project.</p>stephan75Mon, 11 Feb 2013 12:29:37 +0000https://help.openstreetmap.org/questions/19799/calculating-the-distance-length-of-an-osm-way/19822Answer by sanserhttps://help.openstreetmap.org/questions/19799/calculating-the-distance-length-of-an-osm-way/19820<p>For any consecutive points P1(lat1,lon1), P2(lat2,lon2) in a "way" calculate the corresponding P1(x1,y1,z1), P2(v2,y2,z2) and so calculate the cetral angle "alpha" in the corresponding main circle (use the scalar or vector product of the 2 position vectors). The diatnce is then dist=alpha*R (R, the major semi-axis of the WGS'84 sphere).
You can find many related articles by searching, for example using "latitude longitude distance" key-words, like the following one
<a href="http://www.movable-type.co.uk/scripts/latlong.html">http://www.movable-type.co.uk/scripts/latlong.html</a></p>sanserMon, 11 Feb 2013 12:01:14 +0000https://help.openstreetmap.org/questions/19799/calculating-the-distance-length-of-an-osm-way/19820