[gdal-dev] Warp API / gdalwarp: using projection supported by PROJ4, but not explicitly by GDAL?

Martin Lambers marlam at marlam.de
Fri Jul 13 02:49:16 PDT 2012

On Fri, 13 Jul 2012 11:22:13 +0200, Even Rouault wrote:
> > I have added a new projection to PROJ4 (ticket #179), and would like
> > to use it with GDAL Warp.
> >
> > For this purpose, I use the string
> > "+proj=qsc +a=6378137.0 +b=6356752.314245 +lat_0=90 +lon_0=0
> > +units=m" as an argument to the -t_srs option of gdalwarp, and also
> > to OGRSpatialReference::importFromProj4() for passing the result to
> > the Warp API.
> >
> > However, this requires explicit support for the projection not just
> > in PROJ4, but also in GDAL. I currently use the attached patch to
> > add that support, but is there a way to avoid patching GDAL for this
> > purpose?
> To preserve a proj4 string intact through GDAL, you need to add the
> "+wktext" option at the end of the proj.4 string. Unfortunately,
> until recently
> ( http://trac.osgeo.org/gdal/changeset/24063/trunk/gdal/ogr/ogr_srs_proj4.cpp
> which will be released in GDAL 2.0 ), this would still require GDAL
> to be able to recognize the projection method.

Thank you very much Even, this is exactly what I was looking for. I
just tested it with the latest GDAL from SVN and it works perfectly both
with gdalwarp and with the Warp API.

> At first sight, your patch to add support for the qsc method looks
> good (except that I believe that, for consistency with other SRS, the
> words in the SRS_PT_QSC string should be separated with underscore
> rather than space. Would you mind opening a ticket in GDAL Trac with
> it attached.

I could certainly do that, but with the '+wktext' mechanism, there is
no reason to add this patch anymore, is there?

Best regards,

More information about the gdal-dev mailing list