Re: [gdal-dev] gdalwarp's default nodata value

2010-05-11 Thread Chaitanya kumar CH
Joaquim, On Wed, May 12, 2010 at 5:07 AM, Joaquim Luis wrote: > Hi, > > Before filling a ticket I would like to ask here if this gdalwarp behavior > is the intended one. > When I convert a grid from geogs to UTM the nodatavalues are filled with > zeros. > I get the expected behaviour if I use th

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-12 Thread Joaquim Luis
On 12-05-2010 05:55, Chaitanya kumar CH wrote: Joaquim, On Wed, May 12, 2010 at 5:07 AM, Joaquim Luis > wrote: Hi, Before filling a ticket I would like to ask here if this gdalwarp behavior is the intended one. When I convert a grid from geogs to UTM the

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-12 Thread Chaitanya kumar CH
Joaquim, GDALSetRasterNoDataValue() sets only the metadata. It doesn't actually change the nodata pixels. We need to process each pixel to do this. Or you could just create a VRT mentioning the source and vrt nodata values. http://www.gdal.org/gdal_vrttut.html http://www.gdal.org/gdalbuildvrt.htm

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-12 Thread Joaquim Luis
On 12-05-2010 15:58, Chaitanya kumar CH wrote: Joaquim, GDALSetRasterNoDataValue() sets only the metadata. It doesn't actually change the nodata pixels. We need to process each pixel to do this. Or you could just create a VRT mentioning the source and vrt nodata values. Chaitanya, Thanks,

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-12 Thread Even Rouault
Joaquim, I believe what you see is the expected behaviour. You must keep in mind that there are 2 notions : 1) nodata value --> setting it is no more than just setting a "tag" on the raster band. It doesn't change the pixel values by itself as Chaintanya explained 2) initialization of the pixel

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-12 Thread Joaquim Luis
Even, Thanks, I understand it better now and made some advances but I'm still facing some troubles. For example, if I do this papszWarpOptions = CSLSetNameValue(papszWarpOptions, "INIT_DEST", "300" ); psWO->papszWarpOptions = CSLDuplicate(papszWarpOptions); than it works fine. However, if I

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-12 Thread Even Rouault
Le Wednesday 12 May 2010 23:15:08 Joaquim Luis, vous avez écrit : > Even, > > Thanks, I understand it better now and made some advances but I'm still > facing some troubles. > > For example, if I do this > > papszWarpOptions = CSLSetNameValue(papszWarpOptions, "INIT_DEST", "300" ); > psWO->papszWar

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-12 Thread Joaquim Luis
papszWarpOptions = CSLSetNameValue(papszWarpOptions, "INIT_DEST", "nan" ); than I get zeros again in place of the nodata. Works for me. You'll have to use your debugger I'm afraid For the rec, VS2010 and a quite recent trunk version. papszWarpOptions = CSLSetNameValue(papszWarpOp

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-13 Thread Even Rouault
Joaquim, > > For the rec, VS2010 and a quite recent trunk version. Ah, this is the reason for the different results we got. On Windows, atof("nan") returns 0... but on Linux it returns a nan number. I've pushed quite a few changes to trunk to improve the situation on Windows and other changes

Re: [gdal-dev] gdalwarp's default nodata value

2010-05-13 Thread Joaquim Luis
On 13-05-2010 18:38, Even Rouault wrote: Joaquim, For the rec, VS2010 and a quite recent trunk version. Ah, this is the reason for the different results we got. On Windows, atof("nan") returns 0... but on Linux it returns a nan number. I've pushed quite a few changes to trunk to imp