[GRASS-dev] [bug #4368] (grass) g.parser: pass through --o

Radim Blazek radim.blazek at gmail.com
Thu May 11 03:36:15 EDT 2006


On 5/11/06, Glynn Clements <glynn at gclements.plus.com> wrote:
> > Note that it is also possible to set region with GRASS_REGION
> > environment variable.
>
> I wasn't aware of that feature. That would be simpler for running
> commands with a specific region from gis.m.
>
> However, I don't think that the way it is currently implementated is a
> good idea, as it overrides all saved regions as well as the current
> region. I would suggest moving it to G_get_window(), so that programs
> which use G__get_window() to read a specific named region aren't
> affected.

Of course, I moved it to G_get_window(). But then g.region -p
prints WIND file, not GRASS_REGION variable, I am not sure
what it should. Probably it should print GRASS_REGION?

> I've recently fixed a small number of modules which gratuitously used
> G__get_window(..., "WIND") to get the current region.
>
> [Most of these did so in order to handle the case where the current
> region was undefined, and use the default region instead. If that's
> considered a good idea, it should be done in G_get_window() so that it
> works for every module, not by a handful of specific modules.]

I think that undefined region is error and it should result in
G_fatal_error().

> For future development, I'm wondering if it would be a good idea to
> replace the WIND file with a GRASS variable (e.g. REGION) using the
> same syntax as GRASS_REGION.

Do you mean GRASS mapset variable (in VAR)?

I am using WIND as test for mapset in QGIS, exists another way
to test if a directory in location is a mapset?

Radim




More information about the grass-dev mailing list