Cell resolution and g.region?

charnotw charnotw at helios.aston.ac.uk
Mon Aug 7 08:00:00 EDT 1995



> Hi!  I'm new to GRASS and have tried to read all I could about cell 
> size, g.region, r.resample, r.neighbor etc, but am still not clear 
> about what happends to my raster maps when I change the cell size 
> using g.region.
> 
> I have a large database of 10m x 10m cells.  Usually I need the fine 
> resolution to capture important, but narrow, ripparian strips.  
> However, due to size of the database this fine resolution causes 
> problems re processing speeds.  When I change the cell resolution 
> using g.region (to say 100m x 100m cells) I can see the resolution 
> change using d.rast for example, but I'm not sure of how GRASS is 
> getting it's results.  The Grass beginners guide says it's using a 
> nearest neighbour approach and r.resample refers me to r.neighbor, 
> but this command wants to know what method to use (e.g. average, 
> mode, etc) and how big the filter size is (as an odd number).  Since 
> I don't specify any of this when simply changing the cell resolution 
> in g.region, what is GRASS doing?  It is very important for my 
> research that I understand this process.  
> 
> Any suggestions or pointers to more documentation/tutorials that will 
> make this clear would be most appreciated.
> Professor Steven Rose, R.P.F.       Phone: (705) 324-9144
> Sir Sandford Fleming College        FAX:   (705) 878-9312
> PO Box 8000, Lindsay,               Internet: srose at flemingc.on.ca
> Ontario, CANADA K9V 5E6
> 
> 
g.region allows you to change the current GRASS region ie the
north, south, east and west edges and the resolution (n/s & e/w). 
It does NOT change the data, just the way in which the data is 
viewed by you and the way in which it is passed to the other GRASS
programs. You can think of the region as a filter between the
raw data and the applications,  it uses simple nearest neighbour
rule to change the resolution of the data as it is passed to an
application ie each pixel in the region is given the value of the 
raw data pixel whose centroid is closest to its own centroid 
( I think) it clips the data or inserts 0's as necessary around 
the edge. But the  raster data is unchanged.  You can view the 
data in its raw state by setting the current region to match the 
particular raster eg

g.region rast=raster_name  (dont forget d.erase before viewing it 8-)

but their must always be a current region, GRASS expects one.
The current region is kept in a file in your mapset, it is
called WIND (short for window for historical reasons) have
a look and see how it changes when you use g.region. It
also means that the last current region you had when you quit
out of GRASS is still active when you restart.

if you just want to see the current region parameters use

g.region -p 


r.resample actually produces a tangible new raster file
in your mapset. This new raster is based on the current region
at the moment it was created but, like all rasters, it may
be subject to resampling, clipping and packing with zeros
before it is passed to any application.

r.neighbours also produces a new raster file but it allows
much more sophisticated sampling methods. However like other
applications it gets its input data after it has been resampled
to the current region so it is sensible before using to set
the current region to that of the input raster.


cheers  Tom


Tom Charnock                       O--O
Dept Civil Engineering            (~~~~)
Aston University                 (  __  )
Birmingham B4 7ET UK             /|\  /|\
charnotw at sun.aston.ac.uk







More information about the grass-user mailing list