On 16/11/2011 17:27, Matthias Meißer wrote:
Thanks Frederik! I think this will do it :)

bye
Matthias


Just to let you know: I am occasionally running my own script which is kind of similar to Frederik's Perl script. As OSM input data, I am using the .pbf files from [1]

For the Haversine Formula, I followed the explanations at [2]. This formula calculates distances between 2 points on a spherical Earth. There can be 1% of differences compared to distances measured on an ellipsoid. I am using 6367516.477 m as Earth radius, which is the mean of a^2/b and b^2/a, where a and b are the semi-major/minor axis of the WGS84 ellipsoid.

(As a side remark: the distance between 2 nodes of an OSM way is often below 100m, so any considerations about distances on spheres vs. ellipsoids are rather of an academical nature.)

Concerning the issue with dual carriageways, I am using a brute-force approach and divide the calculated distance by 2 if these conditions are true:

highway ~ /^(motorway|trunk|primary|secondary|tertiary)/ &&
 oneway ~ /yes|true|1/

(If someone has a better algorithm: I would be interested.)

Hermann


[1] http://download.geofabrik.de/osm/europe/
[2] http://mathforum.org/library/drmath/view/51879.html

_______________________________________________
talk mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/talk

Reply via email to