raster (version 1.0.4)

area: Size of cells

Description

Compute the approximate surface area of cells in an unprojected (longitude/latitude) RasterLayer. It is an approximation as area is computed as the height of a cell (which is constant among all cells) times the width in the middle of a cell (the width is smaller at the polewards side than at the equator-wards side of a cell). This variation is greatest near the poles and the values are thus not very precise for very high latitudes.

Usage

area(x, ...)

Arguments

x
a Raster* object
...
Additional arguments, see Details

Value

  • a RasterLayer. Cell values represent the size of the cell in km2

Details

The following additional arguments can be passed, to replace default values for this function rll{ filename Filename for the output RasterLayer format Character. Output file type. See writeRaster datatype Character. Output data type. See dataType overwrite Logical. If TRUE, "filename" will be overwritten if it exists progress Character. Valid values are "text", "tcltk", "windows" (on that platform only) and "" }

Examples

Run this code
r <- raster(nrow=18, ncol=36)
a <- area(r)

Run the code above in your browser using DataLab