v.rast.stats.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <h2>DESCRIPTION</h2>
  2. <em>v.rast.stats</em> calculates basic univariate statistics from
  3. a raster map only for the parts covered by the specified vector map.
  4. The vector map will be rasterized according to the raster map resolution.
  5. Then univariate statistics are calculated per vector category (cat) from
  6. the raster map and the results uploaded to the vector map attribute table.
  7. A new column is generated in the attribute table for each statistic requested
  8. in <b>method</b> (if not already present).
  9. <h2>NOTES</h2>
  10. <em>v.rast.stats</em> is only meaningful for lines or polygons.
  11. <p>
  12. The module may take a long time to run if the raster region contains a large
  13. number of cells. In this case the <b>--verbose</b> flag may be used to track
  14. progress.
  15. <p>The script stops if a (prefixed) upload column is already present in the
  16. vector map attribute table, unless otherwise instructed with the <b>-c</b>
  17. continue flag. The column prefix will be separated from the statistic name
  18. with an underscore. For example with a prefix of "<tt>elev</tt>" the sum
  19. column will be named <tt>elev_sum</tt>.
  20. <p>If a DBF database is being used, note that column names are restricted by the
  21. DBF specification to 10 characters. Therefore it is advised to be economical
  22. in the use of the column prefix when using DBF as any additional characters
  23. will be chopped off.
  24. <p>If a MASK is present, it will be restored after the script finished.
  25. The script changes temporarily to the resolution of the given raster map.
  26. <p><!-- r.univar limitation -->
  27. Large amounts of system memory can be used when extended statistics
  28. (<em>first_quartile,median,third_quartile,percentile </em>) are being requested
  29. with a very large region setting. If the region is too large the module
  30. should display memory allocation errors. Basic statistics can be calculated
  31. using any size input region.
  32. <h2>EXAMPLES</h2>
  33. Example to upload DEM statistics to ZIP codes vector map
  34. (North Carolina sample dataset):
  35. <div class="code"><pre>
  36. g.copy vect=zipcodes_wake,myzipcodes_wake
  37. # set computational region to DEM:
  38. g.region raster=elevation -p
  39. # calculate DEM statistics, upload to vector map table:
  40. v.rast.stats myzipcodes_wake raster=elevation \
  41. column_prefix=elev method=minimum,maximum,average,range,stddev,percentile \
  42. percentile=95
  43. # verify results:
  44. v.info -c myzipcodes_wake
  45. v.db.select myzipcodes_wake
  46. v.univar myzipcodes_wake column=elev_range type=centroid
  47. </pre></div>
  48. <h2>SEE ALSO</h2>
  49. <em>
  50. <a href="r.univar.html">r.univar</a>,
  51. <a href="v.univar.html">v.univar</a>,
  52. <a href="v.vect.stats.html">v.vect.stats</a>,
  53. <a href="v.what.rast.html">v.what.rast</a>,
  54. <a href="v.what.rast3.html">v.what.rast3</a>,
  55. <a href="v.what.vect.html">v.what.vect</a>
  56. </em>
  57. <h2>AUTHOR</h2>
  58. Markus Neteler, CEA (for the <a href="http://www.eden-fp6project.net/">EDEN EU/FP6 Project</a>)
  59. <p><i>Last changed: $Date$</i>