[gdal-dev] -srcnodata in gdalwarp and gdalbuildvrt

Richard Greenwood richard.greenwood at gmail.com
Fri Mar 30 07:47:16 PDT 2018


Perfect. Thanks so much! And thank you for showing the syntax for gdalwarp
as well as how to use gdal_edit.py. I would not have figured out these
options without you help.

Best regards,
Rich


On Thu, Mar 29, 2018 at 1:23 PM, Even Rouault <even.rouault at spatialys.com>
wrote:

> On mercredi 28 mars 2018 18:16:45 CEST Richard Greenwood wrote:
> > I have a question that is probably more "user" than "developer". Is there
> > different place that I should post my question?
> >
> > I don't think that I understand -srcnodata. I assume that -srcnodata "0 0
> > 0" on a 3 band image means that all 3 bands have to be 0 to be "no data"
> > but I think what I'm seeing is that if any to the 3 bands is 0 then that
> > pixel is considered to be "no data". Am I mis-understanding -srcnodata?
>
> Richard,
>
> That depends on the utility / algorithm.
>
> For gdalwarp, -srcnodata "0 0 0" will imply by default -wo
> UNIFIED_SRC_NODATA=YES
> See http://www.gdal.org/structGDALWarpOptions.html#
> a0ed77f9917bb96c7a9aabd73d4d06e08
>
> For gdalbuilvrt / VRT (and other raster formats in general), nodata is
> evaluated on each band independantly.
> Unless you specify the NODATA_VALUES metadata item.
>
> gdalbuildvrt out.vrt in1.tif in2.tif
> gdal_edit.py -mo "NODATA_VALUES=0 0 0"
>
> Then utilities/algorithms that can use mask bands (not all can do however)
> will behave as you expect.
>
> Even
>
> --
> Spatialys - Geospatial professional services
> http://www.spatialys.com
>



-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180330/65566e27/attachment.html>


More information about the gdal-dev mailing list