[gdal-dev] gdalwarp multiple nodata

Hare, Trent thare at usgs.gov
Mon Oct 28 10:32:38 PDT 2013


Laura,
  This might be one method for your multiple NoDATA issue.

There is in the python example in the *samples *directory called
val_repl.py (value replace). It allows you to change one value to another
but by switching the line below you can make it greater or less than a
certain value. This might allow to first map all you NoDATA values to a
single NoDATA before running gdalwarp.

original val_repl.py:
http://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples

"val_repl_greater.py" is simply the sample "val_repl.py" (from link above)
with one line changed

replace
    scanline =
numpy.choose(numpy.equal(scanline,inNoData),(scanline,outNoData))
with
    scanline =
numpy.choose(numpy.greater(scanline,inNoData),(scanline,outNoData))

good luck,
Trent


On Mon, Oct 28, 2013 at 6:57 AM, laura0 <lauramail at iol.it> wrote:

> Hi all,
> I have discovered gdalwarp options -srcnodata -dstnodata support just 1 no
> data value per band. Is there a way to set multiple values to NoData?
>
> Thanks much,
> Laura
>
>
>
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/gdalwarp-multiple-nodata-tp5086084.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131028/82f199c3/attachment-0001.html>


More information about the gdal-dev mailing list