measuring area

From grass-lists-owner@moon.cecer.army.mil Fri Oct 13 17:42 WST 1995
From: motte <motte@xs4all.nl>
Message-Id: <199510130834.AA21944@xs1.xs4all.nl>
Subject: Re: measuring area
Sender: grass-lists-owner@moon.cecer.army.mil
To: grassu-list@max.cecer.army.mil
Date: Fri, 13 Oct 1995 09:34:01 +0100 (MET)
X-Mailer: ELM [version 2.4 PL21]
Content-Type: text
Status: RO

>
> Hi all,
> I have a situation in which I am trying to extend (grow) the area of a

patch in a particular direction, depending on the ajacent cell. I want the patc
h to grow only untill it gets to a specified size ( say 20 Hectares). The troub
le I have is stopping t
he> growth.

> I have managed to get the patch to grow by identifying potential growth are

as and runing the script below

>
> I would appreciate any suggestion.
>
> Thanks Joe
>
>
>
> raster map test.g has three categories
>
>
> cat value cat label
> 0 potenial growth
> 5 non growth
> 999 patch value
>
>
> #!/bin/csh -f
> # r.mapcalc script to grow remnant aeras in suitable soil types.
>
> @ i=1
> @ num=10
> echo $i
> echo "this will run through "$num, "loops "
> d.erase
> g.copy rast=test.g,output
> #echo " now using "output.$i--
> while ($i <= $num)
>
> r.mapcalc output.$i = 'if(output,output, eval(if(output[0,-1]==999|| output

[0,1]==999||output[-1,0]==999||output[1,0]==999,999)))'

>
> g.copy rast=output.$i,output
> @ i++
> echo $i
> end
>

Hi Joe,

I'm not pretending to have the best answer, but I'll have a try. Area
measurements in raster maps can be made through r.stats, which will give
the numbers of pixels contained by each category. You want to have a
script that tells r.mapcalc not to grow patches that have exceeded a
certain size. You might try the following: give your patches unique
values (e.g. with r.clump) and have the mapcalc function assign the values
of the clumps to the cells that are to be 'stitched' to the patch. Run
r.stats to see which clumps are now exceeding the size of say 20
hectares and assign a new value (something like -1 or so) to these areas
with r.mapcalc. The next time you start the 'grow' function, exlude these
areas. It's not pretty, but I think it should work; I hope someone can
think of a quicker solution...

By the way, what on earth do you need a function like that for?

Philip Verhagen

--

                      S t i c h t i n g R A A P

              Regionaal Archeologisch Archiverings Projekt

adress: Plantage Muidergracht 14
              1018 TV Amsterdam
              THE NETHERLANDS
phone: (31) 20 525 5835
fax: (31) 20 525 5834
e-mail: motte@xs4all.nl

Thanks to all thoses that responded.
I'll answer Philip's question to the list, in case somebody wants/can suggest a
better prodedure :slight_smile:

I am working on a landscape reconstruction project and landuse allocation model
.
Part of the model is to allocate certain areas of the landscape to convservatio
n. These areas would probably be ajacent to exsisting vegetation remnants.

I have a soil map and a remnant vegetation map. The soil layer has 15 soil type
s. The remnant layer has some 30 remnants scattered through out the region, an
d with in those remnants vegetation types (patches) have been mapped. The veget
ation type is associated with soil type.

The idea is to increase the patches of vegetation type to a minimum size by exp
anding to the ajacent area. The restriction is that the area can only grow on t
he assicated soil type.
What I have done is combined these two maps and for each soil type - vegetation
type combination produced a map of protential growth area. I then run the abov
e script on that map

Thanks Joe