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

Even Rouault even.rouault at mines-paris.org
Fri Jul 13 02:22:13 PDT 2012


Selon Martin Lambers <marlam at marlam.de>:

> Hello everyone,
>
> I have a question about the GDAL Warp API and the gdalwarp utility.
>
> 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.

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.

>
> Best regards,
> Martin




More information about the gdal-dev mailing list