[gdal-dev] Unsupported SRS but available in epsg file

Even Rouault even.rouault at mines-paris.org
Tue Nov 17 08:48:50 EST 2009


Selon Guillaume Sueur <no-reply at neogeo-online.net>:

Guillaume,

I agree that understanding what is the OGR responsibility and what is proj.4
responsability is not always obvious ;-)

When you use "EPSG:xxxx" or "+init=EPSG:xxxxx" as a SRS definition, OGR will try
to resolve the EPSG code from its own CSV data files, and thus will not use
/usr/share/epsg/proj for this. This is normally done with the
$(gdal_data)/gcs.csv or $(gdal_data)/pcs.csv files derived from the EPSG
database. But the simplest way is to add the following line
to $(gdal_data)/cubewerx_extra.wkt

900913,PROJCS["Google Maps Global Mercator",GEOGCS["WGS
84",DATUM["WGS_1984",SPHEROID["WGS
84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_2SP"],PARAMETER["standard_parallel_1",0],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",0],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1],EXTENSION["PROJ4","+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 +wktext  +no_defs"]]

Well, at least, that's the way it works for trunk. No guarantee this works with
GDAL 1.5.X (I think it should be OK though)

Hum, actually while reviewing SVN history, this should be done in 1.5.3
according to http://trac.osgeo.org/gdal/browser/tags/1.5.3/gdal/data. So check
if the GDAL_DATA environnement variable is well defined.

If it still not works, one workaround is to quote the full PROJ4 string
"+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" on the ogr2ogr command line.

Even

> I know it's the official one,  but since it has been introduced in proj
> 4.7 (the server is running 4.5) and OpenLayers still defines it as
> 900913, no chance to get it work with 3857 !
>
>
>
> Le mardi 17 novembre 2009 à 11:33 +0100, Jean-Claude REPETTO a écrit :
> > Guillaume Sueur a écrit :
> > > I have added to that file the famous 900913 definition
> > >
> > > When I try to create a SpatialReference with 900913 code, I run into a
> > > SRSException: Unsupported SRS
> > >
> > > Any hint would be appreciated !
> > >
> >
> > Hi Guillaume,
> >
> > Have you tried EPSG:3857, which is the official EPSG number for this
> > projection ?
> >
> > Jean-Claude
> >
> >
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list