[gdal-dev] GDAL Warp API : Transforms on Z

Even Rouault even.rouault at spatialys.com
Tue Feb 2 03:13:53 PST 2016


Le mardi 02 février 2016 03:07:09, Adam Stambler a écrit :
> Hi All,
> 
> I am trying to implement a warp from a latitude, longitude, altitude (LLA)
> image into a custom coordinate system using the GDAL Warp API.  The
> transform between LLA and my coordinate requires scaling and shifting the
> elevation.  My coordinate system is  a local tangent plane on the Earth's
> surface where x is north, y is east, and z is pointed into the Earth.
> 
> When I follow the instructions in the GDAL Warp API tutorial
> <http://www.gdal.org/warptut.html>,  my custom transform function supplied
> to "psWarpOptions->pTransformerArg
> <http://www.gdal.org/structGDALWarpOptions.html#a35647845a2629da876f379f82d
> 58a2cd>" only receives input z=0 values.  From the source code, it looks
> like the internal GDALWarpKernel only passes z=0 values to to the
> pTransformerArg. The Z values from the source elevation map 

GDALWarpKernel is aimed at warping images that can represent anything, and not 
only elevation maps, so there's no z value to read from. When reprojection is 
involved, the imagery is indeed assumed to be at z=0.

You can specify a DEM in particular cases like RPC transformation. Or if you 
use a coordinate system that uses a proj.4 vertical datum shift grid.
But I'm not completely clear that any of the above really matches your needs.
Perhaps you would need to consider your input raster as a collection of 
points, transform each point independantly with a custom transformation 
method, and then create a grid from the scattered points. GDALWarpKernel 
itself will not alter pixel values other than the effect of the resampling 
kernel used.

> are never used
> and therefore can never be re-projected.
> 
> How can GDAL properly transform the source elevation data if the source
> elevation is never passed to the transform function?
> 
>  How are transforms between ellipsoids or elevation units performed if not
> through the GDALWarpOperation
> <http://www.gdal.org/classGDALWarpOperation.html> API?

> 
> 
> Thank you for any insights.
> 
> -Adam Stambler

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list