Reclass problem

Malcolm Williamson malcolm at cast.uark.edu
Tue Apr 1 15:28:44 EST 1997


On Tue, 1 Apr 1997, Michael Hanratty wrote:

> Fellow GRASS user,
> 
> I have the following raster file that I'd like to reclassify.
> 
> Mapset <washita> in Location <utm14>
> GRASS 4.1 > r.cats map=lulc
> Reading lulc in washita ... 100%
> 0       no data
> 11      urbn
> 12      urbn
> 13      urbn
> 14      urbn
> 16      urbn
> 17      urbn
> 21      past:swht:hay
> 24      agrl
> 31      rnge
> 32      rngb
> 33      rnge
> 41      frsd
> 43      frst
> 53      watr
> 75
> 76
> 
> What I would like to do is to split the areas with category 21 (past:swht:hay) 
> into three categories of equal area.  For example, if category 21 covers 30 
> sq.km., I'd like to divide that area in any manner that is convenient so that I 
> have 10 sq.km. of area with category past, 10 sq.km of area with category swht, 
> and 10 sq.km. of area with category hay.  
> 
> Does anyone have a suggestion for how to do this?  I'd like a procedure that I 
> can automate so that I can apply it to a number of masked regions within a 
> raster layer.

Do you care if the areas are randomly intermixed? If not, use r.random. 
You can apply a mask, generate a new random layer consisting of 33% of 
the area, generate a new mask to include those cells, generate a new 
random layer consisting of 50% of the now available area, and finally use 
r.mapcalc to make a new layer consisting of the remainder (and then put 
them back together). It may not be pretty, but I believe that it would work.
--
Malcolm D. Williamson - GIS Specialist           E-mail: malcolm at cast.uark.edu
Center for Advanced Spatial Technologies      Telephone: (501) 575-6159
Ozark Rm. 12                                        Fax: (501) 575-5218 
University of Arkansas              
Fayetteville, AR 72701






> 
> Thanks.
> Mike
> 
> 
> 
> Michael Hanratty                           Phone: (612) 627-4590
> St. Anthony Falls Laboratory               Fax: (612) 627-4609
> Dept. of Civil Engineering
> University of Minnesota
> Mississippi River @ 3rd Ave. SE
> Minneapolis, MN 55414
> 
> 



More information about the grass-user mailing list