[GRASS-dev] r.null apparently doesn't work on vrt via r.external on G7

Glynn Clements glynn at gclements.plus.com
Fri Dec 20 06:48:21 PST 2013

Margherita Di Leo wrote:

> Is it an expected behaviour that r.null doesn't affect vrt raster linked
> via r.external?


r.null manipulates the null bitmap directly. GDAL-linked (r.external)
maps don't have or use a null bitmap; null cells are those whose value
matches the value reported by the GDALGetRasterNoDataValue() function.

You'll need to either create a mask (e.g. with r.mask) then "apply" it
using e.g. r.resample, or use r.mapcalc to create a copy with the
appropriate categories changed to null, e.g.

r.mapcalc "mosaic.new = if(mosaic==0||mosaic==2||mosaic==3,null(),mosaic)"

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list