Thanks Even, If that is the case, are there other values in psWarpOptions I *have* to set? I can't find docs discussing that.
kss /** * * Kyle Shannon * [email protected] * */ On Thu, May 5, 2011 at 12:21, Even Rouault <[email protected]>wrote: > Le mercredi 04 mai 2011 00:40:42, Kyle Shannon a écrit : > > I am using AutoCreateWarpedVRT to warp a dataset. I grab the the source > > nodata for a band using > > > > double noData = poBand->GetNoDataValue( &pbSuccess ); > > > > which returns 1.#QNAN00000000... on windows. > > > > I then try to set the INIT_DEST with this using > > > > psWarpOptions->papszWarpOptions = > > CSLSetNameValue( psWarpOptions->papszWarpOptions, > > "INIT_DEST", CPLSPrintf( "%lf", noData ) ); > > > > This works on linux when it returns nan(0x8000000000000), but not on > > windows, is there a different string I need to set in the warp options? > > Those NaN values are generally a nighmare to deal with... > > But a quick look at : > > const char *pszInitDest = CSLFetchNameValue( > psOptions->papszWarpOptions, > "INIT_DEST" ); > > if( pszInitDest != NULL && !EQUAL(pszInitDest, "") ) > { > char **papszInitValues = > CSLTokenizeStringComplex( pszInitDest, ",", FALSE, FALSE ); > int nInitCount = CSLCount(papszInitValues); > > for( iBand = 0; iBand < psOptions->nBandCount; iBand++ ) > { > double adfInitRealImag[2]; > GByte *pBandData; > const char *pszBandInit = > papszInitValues[MIN(iBand,nInitCount-1)]; > > if( EQUAL(pszBandInit,"NO_DATA") > && psOptions->padfDstNoDataReal != NULL ) > { > adfInitRealImag[0] = psOptions->padfDstNoDataReal[iBand]; > adfInitRealImag[1] = psOptions->padfDstNoDataImag[iBand]; > } > else > { > CPLStringToComplex( pszBandInit, > adfInitRealImag + 0, adfInitRealImag + > 1); > } > > Make me believe that one way is to assign the value(s) of the > padfDstNoDataReal[] array of psWarpOptions with the noData (NAN) value and > set > INIT_DEST to the "NO_DATA" string. > > > > > Thanks. > > > > > > /** > > * > > * Kyle Shannon > > * [email protected] > > * > > */ >
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
