[gdal-dev] gdalwarp for affine transformation?

Piero Campa piero.campa at gmail.com
Wed Nov 16 01:09:06 PST 2016


Hi,

if you mean to use directly the GDAL library, then have a look at the data
model: http://www.gdal.org/gdal_datamodel.html
You will find the "Affine GeoTransform" section there.

If you are using GDAL utilities, it seems that none of them can let you
define a transformation matrix (is that confirmed?), so I believe that you
might get it through WKT2 [1] and its "Math Transform" API:

 - derive a "fitted CS" [2] with the affine transform you want to apply;
 - use gdal_translate to reproject your original image to the transformed
one.

An example of fitted CS that applies a rotation to the original Google
mercator:

==============================================
FITTED_CS["-22.5°-rotated map CRS",
    PARAM_MT["Affine",
        PARAMETER["num_row",3],
        PARAMETER["num_col",3],
        PARAMETER["elt_0_0",0.9238795325112865],
        PARAMETER["elt_0_1",0.3826834323650904],
        PARAMETER["elt_1_0",-0.3826834323650904],
        PARAMETER["elt_1_1",0.9238795325112865]],
    PROJCS["Google Mercator",
        GEOGCS["WGS 84",
            DATUM["World Geodetic System 1984",
                SPHEROID["WGS 84",6378137.0,298.257223563,
                    AUTHORITY["EPSG","7030"]],
                AUTHORITY["EPSG","6326"]],
            PRIMEM["Greenwich",0.0,
                AUTHORITY["EPSG","8901"]],
            UNIT["degree",0.017453292519943295],
            AXIS["Geodetic latitude",NORTH],
            AXIS["Geodetic longitude",EAST],
            AUTHORITY["EPSG","4326"]],
        PROJECTION["Mercator_1SP"],
        PARAMETER["semi_minor",6356752.314],
        PARAMETER["latitude_of_origin",0.0],
        PARAMETER["central_meridian",0.0],
        PARAMETER["scale_factor",1.0],
        PARAMETER["false_easting",0.0],
        PARAMETER["false_northing",0.0],
        UNIT["m",1.0],
        AXIS["Easting",EAST],
        AXIS["Northing",NORTH],
        AUTHORITY["EPSG","900913"]]]
==============================================

-Piero

 [1]
http://docs.geotools.org/stable/javadocs/org/opengis/referencing/doc-files/WKT.html
 [2]
http://docs.geotools.org/stable/javadocs/org/opengis/referencing/doc-files/WKT.html#FITTED_CS



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/gdal-dev-gdalwarp-for-affine-transformation-tp5062492p5295980.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list