<div dir="ltr">Hello,<br><br>I'm trying to follow the warp tutorial (<a href="http://www.gdal.org/warptut.html">http://www.gdal.org/warptut.html</a>) to do a general warp.  However, I'm not getting any good results.<br>
<br>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.<br>
<br>Second, I tried to create my own, most basic, transformation:<div><br><div><div>int identityTransform(void *pTransformerArg,int bDstToSrc, int nPointCount, double *x, double *y, double *z, int *panSuccess)</div><div>{<br>
</div><div><span class="" style="white-space:pre">        </span>return 1;<br></div><div>}<br><br>i.e. it does not modify any coordinates.  So I changed:</div><div><span class="" style="white-space:pre">    </span>eErr = GDALSuggestedWarpOutput( poDataset, GDALGenImgProjTransform, hTransformArg, adfDstGeoTransform, &nPixels, &nLines );</div>
<div>to:</div><div><span class="" style="white-space:pre">  </span>GDALTransformerFunc myTransformer = &identityTransform;<br><div><span class="" style="white-space:pre">  </span>eErr = GDALSuggestedWarpOutput( poDataset, myTransformer, hTransformArg, adfDstGeoTransform, &nPixels, &nLines );</div>
<div><br></div><div><br></div><div>and<br><div><span class="" style="white-space:pre">  </span>//psWarpOptions->pfnTransformer = GDALGenImgProjTransform;<br></div>to:</div><div>         psWarpOptions->pfnTransformer = myTransformer;<br>
</div><br>I expect to get the same image back but all i get is two vertical lines with unreasonable <span style="color:rgb(0,0,0);font-family:'Lucida Grande',Verdana,Geneva,Arial,sans-serif;font-size:12px;background-color:rgb(251,252,253)">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.<br>
<br>Thank you in advance for any help you can give!<br><br></span></div></div></div></div>