[gdal-dev] GDAL Arbitrary Warp Problems
Michael Aschenbeck
m.g.aschenbeck at gmail.com
Tue Jul 15 11:33:32 PDT 2014
Hello,
I'm trying to follow the warp tutorial (http://www.gdal.org/warptut.html)
to do a general warp. However, I'm not getting any good results.
I first recreated the example in the warp tutorial by first implementing
the bottom portion modified to output an RGB image, then implementing the
top portion with GDALGenImgProjTransform as written. This worked fine.
Second, I tried to create my own, most basic, transformation:
int identityTransform(void *pTransformerArg,int bDstToSrc, int nPointCount,
double *x, double *y, double *z, int *panSuccess)
{
return 1;
}
i.e. it does not modify any coordinates. So I changed:
eErr = GDALSuggestedWarpOutput( poDataset, GDALGenImgProjTransform,
hTransformArg, adfDstGeoTransform, &nPixels, &nLines );
to:
GDALTransformerFunc myTransformer = &identityTransform;
eErr = GDALSuggestedWarpOutput( poDataset, myTransformer, hTransformArg,
adfDstGeoTransform, &nPixels, &nLines );
and
//psWarpOptions->pfnTransformer = GDALGenImgProjTransform;
to:
psWarpOptions->pfnTransformer = myTransformer;
I expect to get the same image back but all i get is two vertical lines
with unreasonable georeferenced coordinates. I'm hoping someone can show
me where I'm going wrong, or guide me to an example of a custom
GDALTransformerFunc to use as a template.
Thank you in advance for any help you can give!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140715/77c1693c/attachment.html>
More information about the gdal-dev
mailing list