[GRASS5] [bug #4065] (grass) gis.m: displaying a map automatically switches resolution back to default

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

Subject: gis.m: displaying a map automatically switches resolution back to default

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs_head_20060207

Using gis.m I get the following:

GRASS 6.1.cvs (ESPON):~ > g.region -p
projection: 99 (Lambert Azimuthal Equal Area)
zone: 0
datum: etrs89
ellipsoid: grs80
north: 2396151
south: -1864119
west: -3717942
east: 2583415
nsres: 1
ewres: 1
rows: 4260270
cols: 6301357

GRASS 6.1.cvs (ESPON):~ > g.region nsres=10000 ewres=10000
GRASS 6.1.cvs (ESPON):~ > g.region -p
projection: 99 (Lambert Azimuthal Equal Area)
zone: 0
datum: etrs89
ellipsoid: grs80
north: 2396151
south: -1864119
west: -3717942
east: 2583415
nsres: 10000.63380282
ewres: 10002.15396825
rows: 426
cols: 630

Now click on "Display active layers in current region" button:

GRASS 6.1.cvs (ESPON):~ > PNG: GRASS_TRUECOLOR status: TRUE
PNG: collecting to file: dispmon_1.ppm,
     GRASS_WIDTH=865, GRASS_HEIGHT=585
Graphics driver [gism] started
Monitor 'gism' terminated

and resolution has automatically (and before map is drawn) been set back to default:

GRASS 6.1.cvs (ESPON):~ > g.region -p
projection: 99 (Lambert Azimuthal Equal Area)
zone: 0
datum: etrs89
ellipsoid: grs80
north: 2396151
south: -1864119
west: -3717942
east: 2583415
nsres: 1
ewres: 1
rows: 4260270
cols: 6301357

(I know the default resolution setting here is not very sensible, but that is not the point :wink: )

Moritz

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

I just realized that this would happen last night. This is due to each map
display having its own, independent region settings. I have a fix planned (a
button to display map in current region).

Until I get a chance to create this, there is a simple work around.

In g.region, save the region to a name. Then use the 'zoom to named region'
button.

You can also save it to "mon_#" where # is the number of the map display
(top of window), and press the display button.

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Request Tracker <grass-bugs@intevation.de>
Reply-To: Request Tracker <grass-bugs@intevation.de>
Date: Tue, 7 Feb 2006 12:24:57 +0100 (CET)
To: <grass5@grass.itc.it>
Subject: [GRASS5] [bug #4065] (grass) gis.m: displaying a map automatically
switches resolution back to default

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

Subject: gis.m: displaying a map automatically switches resolution back to
default

Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs_head_20060207

Using gis.m I get the following:

GRASS 6.1.cvs (ESPON):~ > g.region -p
projection: 99 (Lambert Azimuthal Equal Area)
zone: 0
datum: etrs89
ellipsoid: grs80
north: 2396151
south: -1864119
west: -3717942
east: 2583415
nsres: 1
ewres: 1
rows: 4260270
cols: 6301357

GRASS 6.1.cvs (ESPON):~ > g.region nsres=10000 ewres=10000
GRASS 6.1.cvs (ESPON):~ > g.region -p
projection: 99 (Lambert Azimuthal Equal Area)
zone: 0
datum: etrs89
ellipsoid: grs80
north: 2396151
south: -1864119
west: -3717942
east: 2583415
nsres: 10000.63380282
ewres: 10002.15396825
rows: 426
cols: 630

Now click on "Display active layers in current region" button:

GRASS 6.1.cvs (ESPON):~ > PNG: GRASS_TRUECOLOR status: TRUE
PNG: collecting to file: dispmon_1.ppm,
     GRASS_WIDTH=865, GRASS_HEIGHT=585
Graphics driver [gism] started
Monitor 'gism' terminated

and resolution has automatically (and before map is drawn) been set back to
default:

GRASS 6.1.cvs (ESPON):~ > g.region -p
projection: 99 (Lambert Azimuthal Equal Area)
zone: 0
datum: etrs89
ellipsoid: grs80
north: 2396151
south: -1864119
west: -3717942
east: 2583415
nsres: 1
ewres: 1
rows: 4260270
cols: 6301357

(I know the default resolution setting here is not very sensible, but that is
not the point :wink: )

Moritz

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

Michael Barton wrote:

I just realized that this would happen last night. This is due to each map
display having its own, independent region settings. I have a fix planned (a
button to display map in current region).

I have recently committed a change to G_get_window() such that you can
set the environment variable WIND_OVERRIDE to the name of a stored
region (in the "windows" subdirectory of the current mapset, as per
"g.region save=...") to have G_get_window() use that instead of the
WIND file.

The intended usage is so that gis.m etc can force individual commands
to use a specific region without interfering with command-line usage,
background commands, etc. IOW, commands run from within gis.m should
use "set env(WIND_OVERRIDE) ..." rather than running g.region (you can
use "g.region ... save=..." to create suitable region files).

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

I'm already doing this with gism (hence the individual regions for each map
display). I think that using the new WIND_OVERRIDE will save a few steps in
this.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

From: Glynn Clements <glynn@gclements.plus.com>
Date: Wed, 8 Feb 2006 02:38:41 +0000
To: Michael Barton <michael.barton@asu.edu>
Cc: <grass5@grass.itc.it>
Subject: Re: [GRASS5] [bug #4065] (grass) gis.m: displaying a map
automatically switches resolution back to default

Michael Barton wrote:

I just realized that this would happen last night. This is due to each map
display having its own, independent region settings. I have a fix planned (a
button to display map in current region).

I have recently committed a change to G_get_window() such that you can
set the environment variable WIND_OVERRIDE to the name of a stored
region (in the "windows" subdirectory of the current mapset, as per
"g.region save=...") to have G_get_window() use that instead of the
WIND file.

The intended usage is so that gis.m etc can force individual commands
to use a specific region without interfering with command-line usage,
background commands, etc. IOW, commands run from within gis.m should
use "set env(WIND_OVERRIDE) ..." rather than running g.region (you can
use "g.region ... save=..." to create suitable region files).

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