[gdal-dev] New +axis parameter in PROJ.4 trunk and gdalwarp

Frank Warmerdam warmerdam at pobox.com
Tue Jun 7 15:55:25 EDT 2011


On 11-06-07 03:44 PM, Flo Ledermann wrote:
> Hi all,
>
> PROJ.4 trunk supports a new parameter "+axis" for projection strings to
> define axis orientation. With this you can, for example, create an
> "upside-down" projection by specifying "+axis=wsu" in your projection
> string. (See http://trac.osgeo.org/proj/wiki/GenParms#Axisorientation )
>
> I am trying to use this to create south-up hillshade images. I compiled
> PROJ.4 trunk and GDAL using --with-static-proj4=/usr/local (where my
> PROJ.4 is installed), but gdalwarp seems to just ignore the new
> parameter - the result is the same as with the north-up projection.
>
> Can anyone tell me if this is supposed to work and there's just
> something wrong with my build, or if there is a limitation in GDAL that
> prevents it from working with upside-down projections? Also if you can
> give me any pointers to code where this limitation may be fixed I may be
> able to contribute a patch, if the solution is not too involved.

Flo,

Looking in gdal/ogr/ogr_srs_proj4.cpp which implements the translation
between PROJ.4 and WKT coordinate system formats for GDAL/OGR it seems
the only use of the +axis switch is special cases for Transverse Mercator
South Orientated.  So when you pass a PROJ.4 coordinate system to gdalwarp
it is internally be translated to WKT and then back to PROJ.4 for final use.
The axis definition is lost in those translations.

ogr_srs_proj4.cpp is the place to add support for axes.  WKT does have a way
of describing axis ordering.  However, this is a somewhat complicated change
to make without unexpected side effects.  This is likely why I didn't try to
pursue it when doing the original axis implementation.

For a 180 degree rotated hillshade image it might just be easier to do the
rotation/flipping by adjustments to the geotransform.  The GeoTransform is
an affine transformation and can support flipping, rotation and shearing
if constructed properly.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list