Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 413e0bdb3c48563b2d8d9038d07d5533 > files > 2257

grass-6.3.0-15.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GRASS GIS: v.rast.stats</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">

<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>

<h2>NAME</h2>
<em><b>v.rast.stats</b></em>  - Calculates univariate statistics from a GRASS raster map based on vector polygons and uploads statistics to new attribute columns.
<h2>KEYWORDS</h2>
vector, raster, statistics
<h2>SYNOPSIS</h2>
<b>v.rast.stats</b><br>
<b>v.rast.stats help</b><br>
<b>v.rast.stats</b> [-<b>ce</b>] <b>vector</b>=<em>name</em>  [<b>layer</b>=<em>integer</em>]  <b>raster</b>=<em>name</em> <b>colprefix</b>=<em>string</em>  [<b>percentile</b>=<em>integer</em>]   [--<b>verbose</b>]  [--<b>quiet</b>] 

<h3>Flags:</h3>
<DL>
<DT><b>-c</b></DT>
<DD>Continue if upload column(s) already exist</DD>

<DT><b>-e</b></DT>
<DD>Calculate extended statistics</DD>

<DT><b>--verbose</b></DT>
<DD>Verbose module output</DD>
<DT><b>--quiet</b></DT>
<DD>Quiet module output</DD>
</DL>

<h3>Parameters:</h3>
<DL>
<DT><b>vector</b>=<em>name</em></DT>
<DD>Name of vector polygon map</DD>

<DT><b>layer</b>=<em>integer</em></DT>
<DD>Layer to which the table to be changed is connected</DD>
<DD>Default: <em>1</em></DD>

<DT><b>raster</b>=<em>name</em></DT>
<DD>Name of raster map to calculate statistics from</DD>

<DT><b>colprefix</b>=<em>string</em></DT>
<DD>Column prefix for new attribute columns</DD>

<DT><b>percentile</b>=<em>integer</em></DT>
<DD>Percentile to calculate (requires extended statistics flag)</DD>
<DD>Options: <em>0-100</em></DD>
<DD>Default: <em>90</em></DD>

</DL>
<H2>DESCRIPTION</H2>

<EM><b>v.rast.stats</b></EM> - Calculates basic univariate statistics from
a raster map only for the parts covered by the specified vector map.
The vector map will be rasterized according to the raster map resolution.
Then univariate statistics are calculated per vector category (cat) from
the raster map and the results uploaded to the vector map attribute table.
New columns are generated in the attribute table if not already present.
<p>
Nine columns are generated (n, min, max, range, mean, stddev, variance, 
coeff_var, sum) according to the output of <em>r.univar</em>.
If the <B>-e</B> extended statistics flag is given the 1st quartile,
median, 3rd quartile, and given percentile are also calculated.


<H2>NOTES</H2>

The module may take a long time to run if the raster region contains a large
number of cells. In this case the <B>--verbose</B> flag may be used to track
progress.
<p>
The script stops if a (prefixed) upload column is already present in the
vector map attribute table, unless otherwise instructed with the <B>-c</B>
continue flag. The column prefix will be separated from the statistic name
with an underscore. For example with a prefix of "<tt>elev</tt>" the sum
column will be named <tt>elev_sum</tt>.
<P>
If a DBF database is being used, note that column names are restricted by the
DBF specification to 10 characters. Therefore it is advised to be economical
in the use of the column prefix when using DBF as any additional characters
will be chopped off.
<p>
If a MASK is present, it will be restored after the script finished.
The script changes temporarily to the resolution of the given raster map.
<P>
<!-- r.univar limitation -->
Large amounts of system memory can be used when the <B>-e</B> extended
statistics flag is used with a very large region setting. If the region
is too large the module should display memory allocation errors.
Basic statistics can be calculated using any size input region.


<H2>EXAMPLES</H2>

Example to upload DEM statistics to vector field patches:

<div class="code"><pre>
# work on copy of original map:
g.copy vect=fields,myfields
# if needed, zoom to raster map:
g.region rast=elevation.dem -p
# calculate DEM statistics, upload to vector map table:
v.rast.stats myfields raster=elevation.dem colprefix=dem
# verify results:
v.info -c myfields
v.db.select myfields
v.univar myfields column=dem_range type=centroid
</pre></div>


<H2>SEE ALSO</H2>

<EM>
<A HREF="r.univar.html">r.univar</A>, 
<A HREF="v.univar.html">v.univar</A>,
<a HREF="v.what.rast.html">v.what.rast</a>,
<a href="v.what.vect.html">v.what.vect</a>
</EM>

<H2>AUTHOR</H2>

Markus Neteler, CEA (<a href="http://www.eden-fp6project.net/">EDEN Project</a>)

<p>
<i>Last changed: $Date: 2007-10-10 08:11:21 +0200 (Wed, 10 Oct 2007) $</i>
<HR>
<P><a href="index.html">Main index</a> - <a href="vector.html">vector index</a> - <a href="full_index.html">Full index</a></P>
<P>&copy; 2003-2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></p>
</body>
</html>