[gdal-dev] gdalwarp for affine transformation?

Piero Campalani piero.campa at gmail.com
Thu Jan 26 07:29:14 PST 2017


​Hi there,
just coming back to confirm that the method is successful.

As described in GDAL API tutorial [1], the GeoTransform matrix elements put
X/Y offsets first in the correspondent raws (quite unusual for my own
experience), so by setting the geo-transform matrix as M_g = [ OffX ScaleX
ShearX OffY ShearY ScaleY ] you can get your correct gdalwarped output.

Note that -- having at hand an affine transformation based on geo-units to
apply to an image, I had to *pre-concatenate* it to the pixel-2-world
transform (that is in the GeoTransform node) to make the math work.

Thanks for helping me out !
-Piero

 [1] http://www.gdal.org/gdal_tutorial.html​

On 16 November 2016 at 11:05, Even Rouault <even.rouault at spatialys.com>
wrote:

> 1) # Create a black image of the right size and SRS
> gdal_translate random.tif temp.vrt -of VRT -outsize ... -a_srs ... -scale
> 0 1 0 0
> 2) Edit the <GeoTransform> node in my.vrt
> 3) gdal_translate my.vrt out.tif
> 4) gdalwarp src.tif out.tif
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170126/09a5b843/attachment.html>


More information about the gdal-dev mailing list