<HTML>
<HEAD>
<TITLE>Re: [GRASS-user] raster area problem</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Jason,<BR>
<BR>
To do this, you need to implement some grass commands in a script that iterates. We&#8217;ve done something similar for the Mediterranean Landscape Dynamics project. Our script &#8220;grows&#8221; an agricultural catchment that meets certain criteria (slope below some cutoff and minimizing travel costs to the fields) until it reaches a certain number of hectares (i.e., number of cells).<BR>
<BR>
We iterate over a cost surface. You could do the same. Alternatively, you could start with a small circular mask and increment it with r.grow. At each iteration, you can parse r.info to calculate the number of cultivatable cells. When you reached the desired size, you stop the loop and turn your mask into a raster catchment.<BR>
<BR>
Michael<BR>
__________________________________________<BR>
Michael Barton, Professor of Anthropology<BR>
School of Human Evolution &amp; Social Change &nbsp;&nbsp;&nbsp;<BR>
Center for Social Dynamics &amp; Complexity<BR>
Arizona State University<BR>
<BR>
phone: 480-965-6213<BR>
fax: 480-965-7671<BR>
www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a> <BR>
<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>Jason Jorgenson &lt;jjorgenson@gmail.com&gt;<BR>
<B>Date: </B>Wed, 1 Nov 2006 13:17:14 +0000<BR>
<B>To: </B>&lt;grassuser@grass.itc.it&gt;<BR>
<B>Subject: </B>[GRASS-user] raster area problem<BR>
<BR>
Hi all. &nbsp;This is my first attempt at using the mailing list... <BR>
<BR>
I have digitized a topo map's landuse classes into a vector layer, and then converted the vector to a raster. &nbsp;I want to see how much land would have been required for settlements at point x,y with population of 'P' to sustain themselves. &nbsp;Example, for site 'Shuna' &nbsp;with a population of 5000 I need 16 sq km (of landuse classes 1,2,5 (agricultural,olive,fruit)). &nbsp;&nbsp;<a href="http://arkygeek.blogspot.com">http://arkygeek.blogspot.com</a> <a href="http://arkygeek.blogspot.com/">&lt;http://arkygeek.blogspot.com/&gt;</a> &nbsp;&nbsp;for a crude drawing of what i mean... <BR>
<BR>
&nbsp;What I am trying to do is (ultimately) determine the radius of the circle that will contain 'A' square meters of usable land. &nbsp;These are the general steps I have come up with... <BR>
<BR>
1. &nbsp;the landuse classification data<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- convert the vector layer of classified land to a raster.<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>
2. this new raster will contain 2 values - 0=not usable and 1=usable &nbsp;(??should i do this??) and then I can do this <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- ask for population size of settlement <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- ask for site to analyze which will give xy<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- ask for ratio of crop:fallow &nbsp;(any other variables can be set here as well) <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- computer determines amount of land required to sustain population <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- calculate the radius of a circle surrounding site that encompasses the required amount of land<BR>
<BR>
3. The logic for calculating the radius looks like this: (??????)<BR>
&nbsp;&nbsp;&nbsp;&nbsp;<BR>
&nbsp;&nbsp;&nbsp;&nbsp;for every locality do<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set solution found flag to false <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while solution not found<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;increment proposed radius<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select all cells within proposed radius<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;test if solution is found<BR>
<BR>
4. Once the radius is found, mask the results, convert the results to a vector, and this should give me the solution. (???????)<BR>
<BR>
Any suggestions???<BR>
<BR>
Thanks for your time!<BR>
<BR>
<BR>
<BR>
-- <BR>
Jason Jorgenson<BR>
Post Grad Research Student<BR>
University of Liverpool<BR>
<BR>
&quot;If you don't get out of the box you've been raised in, you won't understand how much bigger the world is.&quot; - Angelina Jolie<BR>
</SPAN></FONT>
</BODY>
</HTML>