cell_area | R Documentation |
Compute the area of a cell
cell_area(raster_layer, unit = "ha")
raster_layer |
|
unit |
|
The input raster must have a projected coordinate system. The distortion is
not corrected. It could be using the cellSize
function of the terra
package, but this function is currently pretty slow for large rasters. If
your problem is at regional scale, the distortion should be negligible.
However, at larger scales, the best is to use an equal-area projected
coordinate system.
numeric
The area of a cell in the desired unit.
## Not run:
habitat_data <- rast(
system.file("extdata", "habitat_hi_res.tif", package = "restoptr")
)
cell_area(habitat_data, "ha")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.