[OSM-dev] Mapnik / General question on projection

M∡rtin Koppenhoefer dieterdreist at gmail.com
Thu Nov 18 17:58:52 GMT 2010

First I must admit that I don't know much about projections, reference
systems and geodetic datums.

I have recently experimented with homemade hillshading and contours,
and I found out by trying that my hillshade was fitting the contours
if I assumed it was in EPSG 3785 (I created the hillshading from SRTM
with Grass GIS and reprojected to an EPSG 900913 setting while the
contours were created with mapnik and srtm2osm).
By reading the EPSG documentation sheets it seems that 3785 and 3857
are not the same (the first uses a sphere, while the latter uses an
ellipsoid with inverse flattening of 298.257223563). EPSG says that
the ellipsoid-version is valid (and registered as 3857) while the
sphere is not. This results visually in quite some change on the map
if you mix it up.

Therefor I thought that Mapnik's 900913 was equal to EPSG's
"non-valid" 3785 version with the sphere. (EPSG states: "Sphere with
radius equal to the semi-major axxis of the GRS80 and WGS84
ellipsoids. Used only for Web approximate mapping and visualisation.
Not recognised by geodetic authorities" --- on which I found some
comments ("EPSG is arrogant") in the web btw. who said it was
perfectly working with the sphere as well, even if not scientifically

Now I found some docs in the OSM-Wiki that state we were using EPSG 3857.

My own tests indicate "we" are using the (not registered) "3785" (sphere).

Also this setting in mapnik/inc/entities.xml.inc indicates this:
<!ENTITY srs900913 "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
+lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs

in generate_image.py I found this (seems that someone changed from
sphere to ellipsoid):
    # prj = mapnik.Projection("+proj=merc +a=6378137 +b=6378137
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null
+no_defs +over")
    prj = mapnik.Projection("+proj=merc +a=6378137 +rf=298.257223563
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null
+no_defs +over")

can someone please tell me which datum is used by the mapnik and T at H
tile servers?


More information about the dev mailing list