<font face="courier new,monospace">Thanks Even,<br>If that is the case, are there other values in psWarpOptions I <i>have</i> to set? I can't find docs discussing that.<br><br>kss<br clear="all"></font><br>/**<br> *<br>
* Kyle Shannon<br> * <a href="mailto:ksshannon@gmail.com" target="_blank">ksshannon@gmail.com</a><br> *<br> */<br><br><br>
<br><br><div class="gmail_quote">On Thu, May 5, 2011 at 12:21, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Le mercredi 04 mai 2011 00:40:42, Kyle Shannon a écrit :<br>
<div class="im">> I am using AutoCreateWarpedVRT to warp a dataset. I grab the the source<br>
> nodata for a band using<br>
><br>
> double noData = poBand->GetNoDataValue( &pbSuccess );<br>
><br>
> which returns 1.#QNAN00000000... on windows.<br>
><br>
> I then try to set the INIT_DEST with this using<br>
><br>
> psWarpOptions->papszWarpOptions =<br>
> CSLSetNameValue( psWarpOptions->papszWarpOptions,<br>
> "INIT_DEST", CPLSPrintf( "%lf", noData ) );<br>
><br>
> This works on linux when it returns nan(0x8000000000000), but not on<br>
> windows, is there a different string I need to set in the warp options?<br>
<br>
</div>Those NaN values are generally a nighmare to deal with...<br>
<br>
But a quick look at :<br>
<br>
const char *pszInitDest = CSLFetchNameValue( psOptions->papszWarpOptions,<br>
"INIT_DEST" );<br>
<br>
if( pszInitDest != NULL && !EQUAL(pszInitDest, "") )<br>
{<br>
char **papszInitValues =<br>
CSLTokenizeStringComplex( pszInitDest, ",", FALSE, FALSE );<br>
int nInitCount = CSLCount(papszInitValues);<br>
<br>
for( iBand = 0; iBand < psOptions->nBandCount; iBand++ )<br>
{<br>
double adfInitRealImag[2];<br>
GByte *pBandData;<br>
const char *pszBandInit =<br>
papszInitValues[MIN(iBand,nInitCount-1)];<br>
<br>
if( EQUAL(pszBandInit,"NO_DATA")<br>
&& psOptions->padfDstNoDataReal != NULL )<br>
{<br>
adfInitRealImag[0] = psOptions->padfDstNoDataReal[iBand];<br>
adfInitRealImag[1] = psOptions->padfDstNoDataImag[iBand];<br>
}<br>
else<br>
{<br>
CPLStringToComplex( pszBandInit,<br>
adfInitRealImag + 0, adfInitRealImag + 1);<br>
}<br>
<br>
Make me believe that one way is to assign the value(s) of the<br>
padfDstNoDataReal[] array of psWarpOptions with the noData (NAN) value and set<br>
INIT_DEST to the "NO_DATA" string.<br>
<div><div></div><div class="h5"><br>
><br>
> Thanks.<br>
><br>
><br>
> /**<br>
> *<br>
> * Kyle Shannon<br>
> * <a href="mailto:ksshannon@gmail.com">ksshannon@gmail.com</a><br>
> *<br>
> */<br>
</div></div></blockquote></div><br>