[Qgis-developer] Openlayers plugin issue

Mathias Walker mwa at sourcepole.ch
Wed Feb 24 04:26:25 EST 2010

Hi Marco

> > The custom SRS should have the following Proj4 config:
> > +proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +a=6378137 +b=6378137
> > +units=m +no_defs
> What is the epsg id of this srs? I'd like to include it to srs.db to have
>  it available by default.

OpenLayers calls the Spherical Mercator projection EPSG:900913. It should be 
equivalent to the deprecated EPSG:3785 (http://www.epsg-
registry.org/export.htm?gml=urn:ogc:def:crs:EPSG::3785) which became EPSG:3875 
(http://www.epsg-registry.org/export.htm?gml=urn:ogc:def:crs:EPSG::3857), but 
in fact they are not exactly the same.

OpenLayers EPSG:900913 (http://trac.openlayers.org/wiki/SphericalMercator):
+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

When setting up a QgsCoordinateReferenceSystem with this definition it returns 
the following Proj4 definition (which is used by the plugin):
+proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +units=m 

EPSG:3785 is already available in QGIS as:
+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 
+towgs84=0,0,0,0,0,0,0 +units=m +no_defs

When using EPSG:3785 as project SRS there is a huge offset to the south of the 
reprojected data relative to the Google map.
It is confusing why EPSG:900913 and EPSG:3785 are not the same, although it is 
very often claimed they are identical.

To include it in the srs.db, it's probably best to use the inofficial EPSG id 
900913 for the Spherical Mercator projection. This would be at least 
consistent with the OpenLayers definition.

Best regards
Mathias Walker
Sourcepole -  Linux & Open Source Solutions
Elestastr. 18   7310 Bad Ragaz  Switzerland
Tel: 081 330 77 11       Fax: 081 330 77 12
mwa at sourcepole.ch  http://www.sourcepole.ch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.osgeo.org/pipermail/qgis-developer/attachments/20100224/0167c653/attachment.bin

More information about the Qgis-developer mailing list