[gdal-dev] Warping with modified source geotransform
Brian Claywell
brian.claywell at gmail.com
Sat Apr 25 04:13:40 EDT 2009
Our image-to-image coregistration process produces an affine
transformation matrix that specifies the pixel-space transformation
necessary to transform the image B to match image A. Since a
geotransform is just an affine pixel-space transformation, the original
image B geotransform can be combined with the coregistration
transformation by matrix multiplication to yield a new image B
geotransform. However, the new image B geotransform is not guaranteed to
be north-up, so the image B (with its modified geotransform) needs to be
warped into a north-up image, and to compute those parameters I've used
the GDALSuggestedWarpOutput() function.
But I've run into a bit of a roadblock. The GDALGenImgProjTransformer
and GDALSuggestedWarpOutput() both read the source geotransform directly
from the source dataset, but I want to inject the modified source
geotransform as described in the above paragraph. Unfortunately, as best
I can tell, it's near impossible to modify the source geotransform of a
GDALGenImgProjTransformer, because the struct definition for
GDALGenImgProjTransformInfo is hidden away inside
alg/gdaltransformer.cpp, so one can't cast from void* to
GDALGenImgProjTransformInfo* to get at the adfSrcGeoTransform member (at
least without replicating the struct definition in my own code, but I'd
really rather avoid breaking GDAL's encapsulation there :) ).
Can anyone think of a way to accomplish this? Or is there a better way
to do this that I haven't thought of?
Thanks!
-b
--
Brian Claywell
brian.claywell at gmail.com
More information about the gdal-dev
mailing list