[josm-dev] Geometric calculations and projections

Tobias Wendorff tobias.wendorff at uni-dortmund.de
Thu Dec 17 22:14:02 GMT 2009


Matthias Julius schrieb:
 >> If you want to use the "normal" Web Mercator, OSM and Google use,
 >> it would be better to use spherical geometry ... it's more accurate
 >> than calculation into a projection and back to LatLon.
 >
 > The point is that things like the state of Wyoming only look
 > rectangular in spherical Mercator projection or similar.

Uhhh ... Spherical Mercator does _not_ preserve shape! That's
because the scale increases from the Equator to the poles.
Okay, on a sphere it might be easy to calculate the distortion...

 >> Spherical geometry allows you to calculate _directly_ on the sphere
 >> without using a projection ... you simple use LatLon in radian
 >> degrees.
 >
 > True, but it's not really trivial.

A rectangle with 89.55°, 90.1°, 89.89°, 90,01° is no rectangle.

 >> I can do some calculations about accurancy the next week, perhaps
 >> sphere is enough ... but as soon as you work on big objects, you
 >> might run into problems.
 >
 > The question is: What is big?

That's pretty easy to calculate:
1. calculate the geodetic distance between & angle two points on WGS84
2. calculate the distance of the distance & angle on other projections
On a point, the error of angle and distance will grow.

 > When does the error become more than, say, 0.1 m?

You were talking about angles, not about distances ;-)

ID;LAT;LON
0;51.0;7.0
1;51.05:7.03
- geodetic distance on WGS84: 5947 m
- Haversine formular (using 6371000 m): 5942 m
Error: +/- 5 m

ID;LAT;LON
0;51.0;7.0
1;51.20:7.20
- geodetic distance on WGS84: 26293 m
- Haversine formular (using 6371000 m): 26260 m
Error: +/- 33 m

Didn't have time to do it with Mercator, perhaps you've got time for it.





More information about the josm-dev mailing list