<DIV>Hello again..</DIV>  <DIV>&nbsp;</DIV>  <DIV>I would like to repost my query to the mailing list regarding the thin plate</DIV>  <DIV>splines... (I now have access to my code and the internet at the same time.)</DIV>  <DIV>&nbsp;</DIV>  <DIV>I was able to get reasonable results using the </DIV>  <DIV>GDALGCPsToGeoTransform function to generate a geo transform, but I would</DIV>  <DIV>like to have an exact fit at the GCPs.&nbsp; That drove me to delve further into the</DIV>  <DIV>GDAL functionality where I ran across the warping functions.</DIV>  <DIV>&nbsp;</DIV>  <DIV>I tried to first use the gdal warper to be able to reproduce the results I got</DIV>  <DIV>using the GDALGCPstoGeoTransform function with the warper.&nbsp; I was</DIV>  <DIV>not able to do that, but here is the code that I wrote.&nbsp; My intention was to</DIV>  <DIV>look at the TPS transform's ability to preserve the GCP values, but I could not</DIV>  <DIV>get that to work, or even to reproduce the
 results from GDALGCPsToGeoTransform</DIV>  <DIV>using regular GCP warping.</DIV>  <DIV>&nbsp;</DIV>  <DIV>I apologize for putting this much code on the mailing but I guess it's the best way....</DIV>  <DIV>&nbsp;</DIV>  <DIV>NOTE:&nbsp; m_pRasterDataset is the dataset that will be used for rendering and is initially&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; loaded as a JPEG dataset with a set of GCPs.&nbsp; (The gcpCount and gcp list</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; are passed in the parameter list for clarity.)</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>//&nbsp;This method transforms gcps and saves in the raster dataset.<BR>//&nbsp;0 = use GDALGCPsToGeoTrans, 1 = use GCP warp, 2 = use TPS GCP warp<BR>bool CGDALGCPImageFile::transformGCPs(int gcpCount, const GDAL_GCP *pGCPList, int
 iMethod)<BR>{<BR>&nbsp;&nbsp;&nbsp; //&nbsp;Ensure we have a good dataset and it hasn't already been loaded.<BR>&nbsp;&nbsp;&nbsp; bool bOK = m_pRasterDataset != NULL &amp;&amp; !hasBeenLoaded();</DIV>  <DIV>&nbsp;&nbsp; &nbsp;if(bOK)<BR>&nbsp;&nbsp; &nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;//&nbsp;Get the regular transform.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double adfGeoTransform[6];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bOK = GDALGCPsToGeoTransform(gcpCount, pGCPList, adfGeoTransform, TRUE);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(iMethod == 0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;Set it and return.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pRasterDataset-&gt;SetGeoTransform(adfGeoTransform);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Set up the warping.<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;char *pszSrcWKT = NULL, *pszDstWKT = NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OGRSpatialReference oSRS;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;oSRS.SetWellKnownGeogCS("WGS84");<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;oSRS.exportToWkt(&amp;pszSrcWKT);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;oSRS.exportToWkt(&amp;pszDstWKT);</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;double defGeoTrans[6] = {0., 1., 0., 0., 0., 1.};<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;Ensure we have&nbsp;set the geo transform as the default.&nbsp;</DIV>  <DIV>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CPLErr err = m_pRasterDataset-&gt;SetGeoTransform(defGeoTrans);</DIV> 
 <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;int i = 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;GDALWarpOptions *psWO = GDALCreateWarpOptions();</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;psWO-&gt;eResampleAlg = GRA_NearestNeighbour;<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;psWO-&gt;pfnProgress = GDALTProgressGCP;</DIV>  <DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//&nbsp;Create the dest dataset.<BR>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;double adfDstGeoTransform[6] = {0., 1., 0., 0., 0., 1.};</DIV>  <DIV>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;//&nbsp;Copy off the raster metadata into a new dataset.<BR>&nbsp;&nbsp;&nbsp; &nbsp;GDALDatasetH hSrcDS = CopyRasterWindow(m_pRasterDataset, 0, 0, <BR>&nbsp;&nbsp;&nbsp;&nbsp; m_pRasterDataset-&gt;GetRasterXSize(), m_pRasterDataset-&gt;GetRasterYSize());</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp; int nBands = GDALGetRasterCount(hSrcDS);<BR>&nbsp;&nbsp;&nbsp;&nbsp; vector&lt;GDALColorInterp&gt;
 srcColors;<BR>&nbsp;&nbsp;&nbsp;&nbsp; for(int i = 1; i &lt;= nBands; i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALRasterBand *poSrcBand = m_pRasterDataset-&gt;GetRasterBand(i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srcColors.push_back(poSrcBand-&gt;GetColorInterpretation());<BR>&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp; if(bOK)<BR>&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;hSrcDS = m_pRasterDataset;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;hDstDS = NULL;</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;nBandCount = GDALGetRasterCount(m_pRasterDataset);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;panSrcBands = (int *) CPLMalloc(sizeof(int) * psWO-&gt;nBandCount);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;panDstBands = (int *) CPLMalloc(sizeof(int) * psWO-&gt;nBandCount);</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i = 0; i
 &lt; psWO-&gt;nBandCount; i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;psWO-&gt;panSrcBands[i] = i+1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;panDstBands[i] = i+1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;Use 0 for GCP regular warp and -1 for TPS warp.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int iGCPWarp = (iMethod == 1) ? 0 : -1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;pfnTransformer = GDALGenImgProjTransform;</DIV>  <DIV>&nbsp;</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; Use NULLs as parameters to get&nbsp;from pixel/line to geocoordinates<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;pTransformerArg = GDALCreateGenImgProjTransformer(psWO-&gt;hSrcDS,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL, NULL, NULL,&nbsp;&nbsp;TRUE, -1.0,
 iMethod);</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;Figure out the desired output bounds and the geo transform.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int nPixels = 0, nLines = 0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CPLErr eErr = GDALSuggestedWarpOutput(m_pRasterDataset, psWO-&nbsp; </DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;pfnTransformer, psWO-&gt;pTransformerArg,&nbsp;adfDstGeoTransform, &amp;nPixels,&nbsp; </DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &amp;nLines);</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;//&nbsp; Update the transformer to include the output geotransform.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;GDALSetGenImgProjTransformerDstGeoTransform(psWO-&gt;pTransformerArg,&nbsp; </DIV> 
 <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; adfDstGeoTransform);</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(bOK)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int nBands = GDALGetRasterCount(m_pRasterDataset);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;dfWarpMemoryLimit = nPixels*nLines*4*8*nBands; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;nBandCount = nBands;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;panSrcBands = (int *) CPLMalloc(psWO-&gt;nBandCount*sizeof(int));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;panDstBands = (int *) CPLMalloc(psWO-&gt;nBandCount*sizeof(int));</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int&nbsp; i = 0; i &lt; psWO-&gt;nBandCount; i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;panSrcBands[i] =
 i+1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;panDstBands[i] = i+1;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;nDstAlphaBand = 0;</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;Create a warped VRT dataset.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALDatasetH hDstDS = GDALCreateWarpedVRT(m_pRasterDataset, nPixels,&nbsp; </DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nLines, adfDstGeoTransform, psWO);<BR>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bOK = (hDstDS != NULL);</DIV>  <DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;if(bOK)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;// Write out the projection definition. <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALSetProjection(hDstDS,
 pszDstWKT);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Copy the color table, if required.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALColorTableH hCT = GDALGetRasterColorTable(GDALGetRasterBand</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (m_pRasterDataset, 1));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(hCT != NULL)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALSetRasterColorTable(GDALGetRasterBand(hDstDS,1), hCT);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Initialize and execute the warp operation.
 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALWarpOperation *oOperation = new GDALWarpOperation;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;hSrcDS = m_pRasterDataset;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; psWO-&gt;hDstDS = hDstDS;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int&nbsp; i = 0; i &lt; nBands; i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((GDALRasterBand *) GDALGetRasterBand(hDstDS,i+1))-&gt;SetAccess</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (GA_Update); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eErr =
 oOperation-&gt;Initialize(psWO);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (eErr == CE_None)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eErr = oOperation-&gt;ChunkAndWarpMulti(0, 0, GDALGetRasterXSize(hDstDS), </DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALGetRasterYSize(hDstDS));<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(eErr == CE_None)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp; Set the colors in the dest.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GDALRasterBand *pBand =
 NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALDataset *pDstDS = (GDALDataset *)hDstDS;</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int i = 1; i &lt;= nBands; i++)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBand = pDstDS-&gt;GetRasterBand(i);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALColorInterp gColor = srcColors[i - 1];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pBand-&gt;SetColorInterpretation(gColor);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</DIV>  <DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;We can
 overwrite the destination as the source dataset.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; delete m_pRasterDataset;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pRasterDataset = (GDALDataset *)hDstDS;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pRasterDataset-&gt;SetGeoTransform(adfDstGeoTransform);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;Clean up.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 GDALDestroyGenImgProjTransformer(psWO-&gt;pTransformerArg);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GDALDestroyWarpOptions(psWO);<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>&nbsp;return bOK;<BR>}<BR></DIV>  <DIV>&nbsp;</DIV>  <DIV>I appreciate any guidance that can be provided!!</DIV>  <DIV>&nbsp;</DIV>  <DIV>Thanks,</DIV>  <DIV>&nbsp;</DIV>  <DIV>Chris Pozsgai</DIV><BR><BR><p>&#32;

<hr size=1>We won't tell. Get more on <a href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265
">shows you hate to love</a><br>(and love to hate): <a href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265
">Yahoo! TV's Guilty Pleasures list.</a>