[GRASS-dev] WIND_OVERRIDE

Hamish hamish_nospam at yahoo.com
Thu Jun 29 07:18:48 EDT 2006


Michael Barton wrote:
> >> g.region -u save=region.save
> >> WIND_OVERRIDE=region.save
> >> export WIND_OVERRIDE # use region.save like WIND but don't change WIND
> >> g.region rast=$input
> > 
> > but now you have in fact changed the region [written to the WIND file]?
> > (but the following modules are using WIND_OVERRIDE so you don't notice)
> 
> Ah. This is where WIND_OVERRIDE (and GRASS_REGION) is useful. For all
> functional purposes (display AND for any GIS operation like query or
> mapcalc output) the region is reset to $input. BUT it is region.save
> that changes, not WIND. Until WIND_OVERRIDE is reset, WIND just sets
> there and nothing happens to it; region.save becomes the active WIND
> file for all activities.

I will try again with a non-grass terminal window watching the WIND file:
(and the same with the region.save file- placing them side by side)

cd ~/grassdata/spearfish60/user1
watch "cat WIND"


then in the GRASS session: (spearfish)

G> g.region -d
G> g.region -p
north:      4928010
south:      4913700
east:       609000
west:       589980
cols:       634
rows:       477
e-w resol:  30
n-s resol:  30


G> g.region -u save=region.save
G> g.region -p

[same as WIND; region.save is the same region as DEFAULT_WIND now]

G> export WIND_OVERRIDE=region.save

G> g.region rast=elevation.10m

Yes, you are right, I see region.save is the one that changes to res=10m.

G> g.region -p
nsres=10
G> r.univar elevation.10m
2654802 cells (= 10m res)

G> unset WIND_OVERRIDE  # probably bad to g.remove region.save before unsetting!
G> g.region -p
nsres=30

G> g.remove region=region.save


So both methods are ok - I'm slowly getting my head around it.



Hamish




More information about the grass-dev mailing list