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

Hi All,

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

Tested on forest map 2000 available for download from http://forest.jrc.ec.europa.eu/download/data/forest-data-download/

I build the mosaic with gdalbuildvrt and then use r.external

then I want to set to null the values 0,2,3:
r.null mosaic setnull=0-2-3

this command doesn’t have any effect on the map.

thanks

madi

Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.

I thought r.external was a read-only link.

Doug

···

On Thu, Dec 19, 2013 at 3:35 AM, Margherita Di Leo <dileomargherita@gmail.com> wrote:

Hi All,

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

Tested on forest map 2000 available for download from http://forest.jrc.ec.europa.eu/download/data/forest-data-download/

I build the mosaic with gdalbuildvrt and then use r.external

then I want to set to null the values 0,2,3:
r.null mosaic setnull=0-2-3

this command doesn’t have any effect on the map.

thanks

madi

Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may not in any circumstance be regarded as stating an official position of the European Commission.


grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb@fws.gov

The opinions I express are my own and are not representative of the official policy of the U.S.Fish and Wildlife Service or Dept. of the Interior. Life is too short for undocumented, proprietary data formats.

On Thu, Dec 19, 2013 at 9:46 AM, Newcomb, Doug <doug_newcomb@fws.gov> wrote:

I thought r.external was a read-only link.

r.external manual does not say anything about it. However, the example

there is read-only. And I'm not sure in which category (r/rw) r.null is.

http://grass.osgeo.org/grass70/manuals/r.external.html
http://grass.osgeo.org/grass70/manuals/r.null.html

Doug

On Thu, Dec 19, 2013 at 3:35 AM, Margherita Di Leo <
dileomargherita@gmail.com> wrote:

Hi All,

Is it an expected behaviour that r.null doesn't affect vrt raster linked
via r.external?
Tested on forest map 2000 available for download from
http://forest.jrc.ec.europa.eu/download/data/forest-data-download/
I build the mosaic with gdalbuildvrt and then use r.external
then I want to set to null the values 0,2,3:
r.null mosaic setnull=0-2-3
this command doesn't have any effect on the map.

thanks

madi

--
Best regards,

Dr. Margherita DI LEO
Scientific / technical project officer

European Commission - DG JRC
Institute for Environment and Sustainability (IES)
Via Fermi, 2749
I-21027 Ispra (VA) - Italy - TP 261

Tel. +39 0332 78 3600
margherita.di-leo@jrc.ec.europa.eu

Disclaimer: The views expressed are purely those of the writer and may
not in any circumstance be regarded as stating an official position of the
European Commission.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

--
Doug Newcomb
USFWS
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb@fws.gov

---------------------------------------------------------------------------------------------------------
The opinions I express are my own and are not representative of the
official policy of the U.S.Fish and Wildlife Service or Dept. of the
Interior. Life is too short for undocumented, proprietary data formats.

_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Margherita Di Leo wrote:

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

Yes.

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@gclements.plus.com>

Hi,

I have merged the ML comments into the manual, see
r58497.

Markus