<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 05/30/2012 11:07 PM, Alejandro Coca Castro wrote:
<blockquote
cite="mid:CAOFM_V2-+S6NVJXHxz5fqWdtLRE4LGztp9u+j4cOK6hS2syjhA@mail.gmail.com"
type="cite">
<div class="post-text">
<p>Hi, i have a raster file about land usage (crops / urban
areas ecc..)</p>
<p>I have defined some zones around some given points of a
vector layer and I'd like to calculate the % of those areas
occupied by each value of the raster file in order to make an
estimate on the average usages of the selected areas.</p>
<p>I know that in arcgis there is a function to do so called
"Tabulate Areas", but I can't find such feature in GRASS.</p>
</div>
</blockquote>
<br>
I think you can use r.stats for this. First rasterize your (vector)
areas with v.to.rast. Use a numeric column for the "use=attr"
option. Then use r.stats with both the landuse raster and the zones
raster as input.<br>
So if you have a "landuse" raster, and a "zones" vector with i.e. a
"zone_id" column, then:<br>
<br>
v.to.rast in=zones out=zones use=attr colu=zone_id<br>
r.stats -p in=zones,landuse fs=, out=landuse_zones_percent.csv<br>
<br>
<blockquote
cite="mid:CAOFM_V2-+S6NVJXHxz5fqWdtLRE4LGztp9u+j4cOK6hS2syjhA@mail.gmail.com"
type="cite">
<div class="post-text">
<p>If anyone can help me I'd be so grateful.</p>
<p>Regards,<br>
</p>
</div>
<br clear="all">
<br>
-- <br>
<b><i><span
style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#404040">Alejandro
Coca Castro</span></i></b><b><i><span
style="font-size:9.0pt;font-family:"Arial","sans-serif";color:black"></span></i></b><b><i><span
style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#00502e"></span></i></b><span
style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#404040"></span>
<b><i><span
style="font-size:8.0pt;font-family:"Arial","sans-serif";color:black"
lang="ES-CO"></span></i></b><i><span
style="font-size:9.0pt;font-family:"Arial","sans-serif";color:#404040"></span></i><br>
<br>
This mail was received via Mail-SeCure System.<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
This mail was received via Mail-SeCure System.
</pre>
</blockquote>
<br>
</body>
</html>