[gdal-dev] Identity affine handling in GDALCreateGenImgProjTransformer2

Even Rouault even.rouault at spatialys.com
Mon Sep 1 06:45:23 PDT 2014


Hi Sandro

>
> Basically it looks like the code doesn't not trust the return code
> from the driver's GDALGetGeoTransform() call, but rather look at the
> returned matrix to decide if the raster did have or not a an affine
> transformation.

Yes, there are indeed various places where we don't trust GetGeoTransform()
return code. I guess this is for historical reasons. This is a bit unfortunate
and should be fixed at driver level rather than handled by GDAL core. Perhaps
you could try removing the test on the geotransform values in
GDALCreateGenImgProjTransformer2 () and see if it impacts the autotest suite ?
(though it would not be a proof that some
audit of drivers would not be required so that we can reliably trust the return
code of their GetGeoTransform() implementation)

>
> The error message I get when passing rasters with that affine to the
> function is indeed:
>
>  ERROR 1: Unable to compute a transformation between pixel/line
>  and georeferenced coordinates for .
>  There is no affine transformation and no GCPs.
>
> But the raster _does_ have an affine transformation, just happens to
> be the identity one.
>
> Should the GDALCreateGenImgProjTransformer2 not threat the identity matrix
> in a special way ?

In theory, there's nothing wrong with the identity matrix. Shouldn't be a
particular case in the rest of the warping.

Best regards,

Even


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


More information about the gdal-dev mailing list