[Gdal-dev] gdalwarp + nosrcdata
Frank Warmerdam
warmerdam at pobox.com
Wed Mar 10 19:36:35 EST 2004
Robert Osfield wrote:
> Hi,
>
> I have been using the GDAL Warp API successful for a while without filtering
> out no source data. I now am using a dataset that I'd like to manage the no
> source data, and the API appears to support this, but as yet I haven't been
> able to get it to work. I'm setting up both the padfSrcNoDataReal/Imag and
> padfDstNoDataReal/Img, but none of these settings appear to make any
> difference to the final resultant image.
>
> I haven't found anything in the docs or warp tutorial to clarify all the
> details, but looking at the gdalwap app source it looks like my
> implementation shouldn't be too far off the mark.
>
> I have tried out the gdalwap app as well, and still see the same problem with
> no source data making its way into the final warp image.
>
> I'm not sure what to expect from gdalwarp, so a few pointers of what to expect
> to be able to do, and how to go about it would be great. I've pasted details
> on what I've tried just in case this helps pinpoint the what steps I'm
> missing.
Robert,
It looks like you are on the right track. I am not sure why it isn't working.
I tried the command "gdalwarp -srcnodata -32768 nzdem500 out.tif" to warp
a dem in ESRI Grid format to a tiff file, and it correctly ignore the -32768
values leaving the default value of 0 in the output file.
Is it possible you are working with an older version of the Warp API?
I think the comparisons are being done as floating point, so I am a bit
concerned that there may be floating point roundoff issues representing some
values properly. I don't know if that is what might be happening here.
So, first verify you are using current code. (1.2.0a/b or a recently
nightly snapshot) If it still doesn't work with a commandline form like the
above, then send me the DEM privately and I will see if I can reproduce the
problem.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Gdal-dev
mailing list