[GRASS-dev] [bug #4428] (grass) gis.m/r.what incompatible: quering rasters outside current region doesn't work

this bug's URL: http://intevation.de/rt/webrt?serial_num=4428
-------------------------------------------------------------------------

Subject: gis.m/r.what incompatible: quering rasters outside current region doesn't work

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 2006-05-08

Quering rasters in gis.m doesn't work properly because r.what depends on current region settings, which gis.m ignores. False nulls are returned as an efect.

Can r.what be fixed to query raster outside the current region?

Maciek

-------------------------------------------- Managed by Request Tracker

Request Tracker wrote:

this bug's URL: http://intevation.de/rt/webrt?serial_num=4428
-------------------------------------------------------------------------

Subject: gis.m/r.what incompatible: quering rasters outside current region doesn't work

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 2006-05-08

Quering rasters in gis.m doesn't work properly because r.what depends on current region settings, which gis.m ignores. False nulls are returned as an efect.

Can r.what be fixed to query raster outside the current region?

Wrong solution. gis.m needs to set WIND_OVERRIDE correctly before
calling r.what.

--
Glynn Clements <glynn@gclements.plus.com>

> this bug's URL: http://intevation.de/rt/webrt?serial_num=4428
> -------------------------------------------------------------------
>
> Subject: gis.m/r.what incompatible: quering rasters outside current
> region doesn't work

..

> GRASS Version: 2006-05-08
>
> Quering rasters in gis.m doesn't work properly because r.what
> depends on current region settings, which gis.m ignores. False nulls
> are returned as an efect.
>
> Can r.what be fixed to query raster outside the current region?

Wrong solution. gis.m needs to set WIND_OVERRIDE correctly before
calling r.what.

WIND_OVERRIDE and GRASS_REGION are not documented in the enviroment
variables help page,
http://grass.ibiblio.org/grass61/manuals/html61_user/variables.html

Can someone describe how to use them?

thanks,
Hamish

Hamish wrote:

> > this bug's URL: http://intevation.de/rt/webrt?serial_num=4428
> > -------------------------------------------------------------------
> >
> > Subject: gis.m/r.what incompatible: quering rasters outside current
> > region doesn't work
..
> > GRASS Version: 2006-05-08
> >
> > Quering rasters in gis.m doesn't work properly because r.what
> > depends on current region settings, which gis.m ignores. False nulls
> > are returned as an efect.
> >
> > Can r.what be fixed to query raster outside the current region?
>
> Wrong solution. gis.m needs to set WIND_OVERRIDE correctly before
> calling r.what.

WIND_OVERRIDE and GRASS_REGION are not documented in the enviroment
variables help page,
http://grass.ibiblio.org/grass61/manuals/html61_user/variables.html

Can someone describe how to use them?

First and foremost, the user should not set WIND_OVERRIDE in a GRASS
session. It's meant to be set locally for specific commands. It's
debatable whether it belongs in the users' manual.

As for what it does:

  int G_get_window (struct Cell_head *window )
  {
  
  ...
  
    wind = getenv("WIND_OVERRIDE");
    if (wind)
        err = G__get_window (&dbwindow,"windows",wind,G_mapset());
    else
        err = G__get_window (&dbwindow,"","WIND",G_mapset());

It causes programs to use the specified named region (created with
e.g. "g.region save=...") to be used as the current region, instead of
the region from the WIND file.

This allows programs such as gis.m to run external commands on an
alternate region without having to modify the WIND file then change it
back afterwards.

--
Glynn Clements <glynn@gclements.plus.com>