EVOLUTION-MANAGER
Edit File: surfaceArea.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Compute surface area of a digital elevation model.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for surfaceArea {sp}"><tr><td>surfaceArea {sp}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Compute surface area of a digital elevation model. </h2> <h3>Description</h3> <p>It is often said that if Wales was flattened out it would have an area bigger than England. This function computes the surface area of a grid of heights taking into account the sloping nature of the surface. </p> <h3>Usage</h3> <pre> surfaceArea(m, ...) surfaceArea.matrix(m, cellx = 1, celly = 1, byCell = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>m</code></td> <td> <p>a matrix of height values, or an object of class <a href="SpatialGridDataFrame.html">SpatialPixelsDataFrame</a> or <a href="SpatialGridDataFrame.html">SpatialGridDataFrame</a>. </p> </td></tr> <tr valign="top"><td><code>cellx</code></td> <td> <p>the size of the grid cells in the x-direction, in the same units as the height values. </p> </td></tr> <tr valign="top"><td><code>celly</code></td> <td> <p>the size of the grid cells in the y-direction, in the same units as the height values. </p> </td></tr> <tr valign="top"><td><code>byCell</code></td> <td> <p>return single value or matrix of values </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>ignored</p> </td></tr> </table> <h3>Value</h3> <p>Either a single value of the total area if byCell=FALSE, or a matrix the same shape as m of individual cell surface areas if byCell=TRUE. In this case, the sum of the returned matrix should be the same value as that which is returned if byCell=FALSE. </p> <p>Missing values (NA) in the input matrix are allowed. They will produce an NA in the output matrix for byCell=TRUE, and contribute zero to the total area. They also have an effect on adjacent cells - see code comments for details. </p> <h3>Methods</h3> <dl> <dt>obj = "matrix"</dt><dd><p> takes a matrix as input, requires cellx and celly to be set </p> </dd> <dt>obj = "SpatialGridDataFrame"</dt><dd><p> takes an object of class <a href="SpatialGridDataFrame.html">SpatialGridDataFrame</a> as input, and retrieves cellx and celly from this </p> </dd> <dt>obj = "SpatialPixelsDataFrame"</dt><dd><p> takes an object of class <a href="SpatialGridDataFrame.html">SpatialPixelsDataFrame</a> as input, and retrieves cellx and celly from this </p> </dd> </dl> <h3>Author(s)</h3> <p>Barry Rowlingson <b.rowlingson@lancaster.ac.uk>, integration in sp Edzer Pebesma. </p> <h3>References</h3> <p>Calculating Landscape Surface Area from Digital Elevation Models, Jeff S. Jenness Wildlife Society Bulletin, Vol. 32, No. 3 (Autumn, 2004), pp. 829-839 </p> <h3>Examples</h3> <pre> surfaceArea(volcano) image(surfaceArea(volcano,byCell=TRUE)) data(meuse.grid) gridded(meuse.grid) = ~x+y image(surfaceArea(meuse.grid["dist"], byCell=TRUE)) surfaceArea(meuse.grid["dist"]) </pre> <hr /><div style="text-align: center;">[Package <em>sp</em> version 1.4-2 <a href="00Index.html">Index</a>]</div> </body></html>