v.rast.stats.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. <p>
  10. The univariate statistics include the number of raster cells counted,
  11. the number of raster NULL cells counted, minimum
  12. and maximum cell values, range, average, <!-- r.univar: arithmetic mean -->
  13. standard deviation, variance, coefficient of variation, sum, first quartile,
  14. median, third quartile, and percentile.
  15. <h2>NOTES</h2>
  16. <em>v.rast.stats</em> is only meaningful for lines or polygons.
  17. <p>
  18. The module may take a long time to run if the raster region contains a large
  19. number of cells. In this case the <b>--verbose</b> flag may be used to track
  20. progress.
  21. <p>The script stops if a (prefixed) upload column is already present in the
  22. vector map attribute table, unless otherwise instructed with the <b>-c</b>
  23. continue flag. The column prefix will be separated from the statistic name
  24. with an underscore. For example with a prefix of "<tt>elev</tt>" the sum
  25. column will be named <tt>elev_sum</tt>.
  26. <p>If a DBF database is being used, note that column names are restricted by the
  27. DBF specification to 10 characters. Therefore it is advised to be economical
  28. in the use of the column prefix when using DBF as any additional characters
  29. will be chopped off.
  30. <p>If a MASK is present, it will be restored after the script finished.
  31. The script changes temporarily to the resolution of the given raster map.
  32. <p>If an area has several categories in the selected layer (equivalent
  33. to overlapping polygons in Simple Features), only one category will be
  34. kept during the rasterization process. Statistics for the skipped
  35. categories will thus be partial.
  36. <p>
  37. For example, if there are three areas: area 1 with cat 1, area 2 with
  38. cat 2, area 3 with cats 1, 2. Only one category value of area 3 will be
  39. used for rasterization, the other category value will be skipped. Thus
  40. statistics for the used category value will be complete, while
  41. statistics for the skipped category value will be incomplete.
  42. <p><!-- r.univar limitation -->
  43. Large amounts of system memory can be used when extended statistics
  44. (<em>first_quartile,median,third_quartile,percentile </em>) are being requested
  45. with a very large region setting. If the region is too large the module
  46. should display memory allocation errors. Basic statistics can be calculated
  47. using any size input region.
  48. <h2>EXAMPLES</h2>
  49. Example to upload DEM statistics to ZIP codes vector map
  50. (North Carolina sample dataset):
  51. <div class="code"><pre>
  52. g.copy vect=zipcodes_wake,myzipcodes_wake
  53. # set computational region to DEM:
  54. g.region raster=elevation -p
  55. # calculate selected DEM statistics, upload to vector map table:
  56. v.rast.stats myzipcodes_wake raster=elevation \
  57. column_prefix=elev method=minimum,maximum,average,range,stddev,percentile \
  58. percentile=95
  59. # verify results:
  60. v.info -c myzipcodes_wake
  61. v.db.select myzipcodes_wake
  62. v.univar myzipcodes_wake column=elev_range type=centroid
  63. </pre></div>
  64. <h2>SEE ALSO</h2>
  65. <em>
  66. <a href="r.univar.html">r.univar</a>,
  67. <a href="v.univar.html">v.univar</a>,
  68. <a href="v.vect.stats.html">v.vect.stats</a>,
  69. <a href="v.what.rast.html">v.what.rast</a>,
  70. <a href="v.what.rast3.html">v.what.rast3</a>,
  71. <a href="v.what.vect.html">v.what.vect</a>
  72. </em>
  73. <h2>AUTHOR</h2>
  74. Markus Neteler, CEA (for the <a href="http://www.eden-fp6project.net/">EDEN EU/FP6 Project</a>)
  75. <!--
  76. <p>
  77. <i>Last changed: $Date$</i>
  78. -->