r.li.mpa.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <h2>DESCRIPTION</h2>
  2. <em>r.li.mpa</em> (mean pixel attribute) calculates the average value of the
  3. attribute of all the non-null cells in the sampling area as:<br>
  4. <img src="rlimpa_formula.png" alt="rlimpa formula"> <br>
  5. with:<br>
  6. <ul>
  7. <li><b>i</b>: attribute</li>
  8. <li><b>m</b>: number of non-null attributes in the sampling area </li>
  9. <li><b>w<small><small>i</small></small></b>: number of cells of attribute i</li>
  10. <li><b>size</b>: size of sampling area (in cells)</li>
  11. </ul>
  12. <h2>NOTES</h2>
  13. Do not use absolute path names for the <b>config</b> and <b>output</b>
  14. file/map parameters.
  15. If the "moving window" method was selected in <b>g.gui.rlisetup</b>, then the
  16. output will be a raster map, otherwise an ASCII file will be generated in
  17. the folder <tt>C:\Users\userxy\AppData\Roaming\GRASS7\r.li\output\</tt>
  18. (MS-Windows) or <tt>$HOME/.grass7/r.li/output/</tt> (GNU/Linux).
  19. <p>
  20. <!-- TODO: verify next: -->
  21. If the input raster map contains only NULL values then <em>r.li.mpa</em> considers to
  22. have 0 patches.<br>
  23. If area is 0 <em>r.li.mpa</em> returns -1; it is possible only if the
  24. raster is masked <br>
  25. If you want to change these -1 values to NULL, run subsequently on the resulting map:
  26. <div class="code"><pre>
  27. r.null setnull=-1 input=my_map
  28. </pre></div>
  29. after index calculation.
  30. <h2>EXAMPLES</h2>
  31. To calculate the mean pixel attribute index on map <em>my_map</em>, using
  32. <em>my_conf</em> configuration file (previously defined with
  33. <em>g.gui.rlisetup</em>) and saving results in <em>my_out</em>, run:
  34. <div class="code"><pre>
  35. r.li.mpa input=my_map conf=my_conf output=my_out
  36. </pre></div>
  37. <p>
  38. Forest map (Spearfish sample dataset) example:
  39. <div class="code"><pre>
  40. g.region raster=landcover.30m -p
  41. r.mapcalc "forests = if(landcover.30m >= 41 && landcover.30m <= 43,1,null())"
  42. r.li.mpa input=forests conf=movwindow7 out=forests_mpa_mov7
  43. r.univar forests_mpa_mov7
  44. </pre></div>
  45. <p>
  46. Forest map (North Carolina sample dataset) example:
  47. <div class="code"><pre>
  48. g.region raster=landclass96 -p
  49. r.mapcalc "forests = if(landclass96 == 5, 1, null() )"
  50. r.li.mpa input=forests conf=movwindow7 out=forests_mpa_mov7
  51. # verify
  52. r.univar forests_mpa_mov7
  53. r.to.vect input=forests output=forests type=area
  54. d.mon wx0
  55. d.rast forests_mpa_mov7
  56. d.vect forests type=boundary
  57. </pre></div>
  58. <h2>SEE ALSO</h2>
  59. <em>
  60. <a href="r.li.html">r.li</a> - package overview<br>
  61. <a href="g.gui.rlisetup.html">g.gui.rlisetup</a>
  62. </em>
  63. <h2>REFERENCES</h2>
  64. McGarigal, K., and B. J. Marks. 1995. FRAGSTATS: spatial pattern
  65. analysis program for quantifying landscape structure. USDA For. Serv.
  66. Gen. Tech. Rep. PNW-351. (<a href="http://treesearch.fs.fed.us/pubs/3064">PDF</a>)
  67. <h2>AUTHORS</h2>
  68. Serena Pallecchi student of Computer Science University of Pisa (Italy).<br>
  69. Commission from Faunalia Pontedera (PI), Italy (www.faunalia.it)<br>
  70. Markus Metz
  71. <p>
  72. <i>Last changed: $Date$</i>