Thanks for your response. For my application, I will be creating the transformation on the fly. It will be a non-standard transformation. Unless I'm mistaken, I don't believe this can be done with gdalwarp directly.
Also, I am under the assumption that its source code is introduced in the tutorial I am working off of (http://www.gdal.org/warptut.html). Yet, this just introduces a standard transformation, not a custom one. This is why I'm having trouble. Thanks, Mike On Tue, Jul 15, 2014 at 12:43 PM, Even Rouault <[email protected] > wrote: > Le mardi 15 juillet 2014 20:33:32, Michael Aschenbeck a écrit : > > 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! > > Why not using gdalwarp directly, or re-using its source code ? > > -- > Geospatial professional services > http://even.rouault.free.fr/services.html >
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
