calcArea: Calculate Cell Raster Area

Description Usage Arguments Value Author(s) Examples

View source: R/calcArea.R

Description

Function calculates the area of a raster file. Either a raster file is directly specified, or defined by it's resolution, projection and extent. Method works for input in longlat or equal area projection with unit in meters.

Usage

1
calcArea(x=NULL, res=NULL, proj=NULL, ext=NULL, cache=T, writecache=T)

Arguments

x

File for which the area should be calculated

res

Resolution for which calculations should be done. If only one number is specified, assumes square cells

proj

projection as CRS. e.g. "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"

ext

extent for calculations. e.g. c(-180,180,-90,90)

cache

if TRUE function looks for pre-calculated area in cache

writecache

if TRUE function writes newly calculated area to cache folder

Value

Either a raster or just the number for equal area projections

Author(s)

Ulrich Kreidenweis

Examples

1
2
3
## Not run: calcArea(res=0.5, proj="+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0",
         ext=c(-180,180,-90,90))
## End(Not run)

pik-piam/geodata documentation built on Nov. 5, 2019, 12:21 a.m.