masking

William L. Baker BakerWL at uwyo.edu
Tue Jan 9 07:00:00 EST 1996



One way is to use r.mask to create a mask, then save it as a separate
raster map (g.copy rast=MASK,county1).  Do this for each county.
Then make a script which first copies the county1 map into MASK,
(g.copy rast=county1,MASK), then do your operation, then copy
county2 map...etc.  MASK is really a reclass file, but it shows up
in your list of raster maps, so it can be treated like a raster map.
The program r.mask just provides an interface to do the reclassing
etc.  You can of course sidestep r.mask completely.  Just make
separate reclass maps for each county (county to be studied = 1,
other counties = 0), then use g.copy as above.

Bill Baker
 ----------
From: grassu-list
Sender: grass-lists-owner at moon.cecer.army.mil.
Reply-To: grassu-list at moon.cecer.army.mil.
Precedence: Bulk
To: grassu
Cc: sue
Subject: masking
Date: Monday, January 08, 1996 4:02PM

Thanks in advance for your help.

I am working with soils data in raster format at Iowa State University.  I
have masked a township one section at a time and need to produce r.report
files for each section.  I need to do this for seven maps per section and
would like to automate the process since eventually I will need to make
files for an entire county.  My problem is that r.mask is not interactive
and can't be included in a shell script.  I tried to achieve a mask-like
effect with g.region but it gave me a 90 degree box, not the skewed boundary
of a section.  This affects the results listed in r.report such as acres and
cell count.

I am looking for a non-interactive mask command that I hope was written by
someone intending to automate the masking of many files.  I would also be
happy to hear if there is a way to achieve similar results with existing
GRASS 4.1 commands.   Thank you.


Robin McNeely
Department of Landscape Architecture








More information about the grass-user mailing list