gridarea2d: Returns the area for a lon/lat grid.

gridarea2dR Documentation

Returns the area for a lon/lat grid.

Description

The function returns a data.table of area in square meters of a lon-lat grid. Coordinates must be gridcell midpoint and the northern and southern edges are calculated as half of the distance to the next element in the latitude vector. Uses gridarea1d.

Usage

gridarea2d(lon, lat, scale = 1, ellipse = FALSE)

Arguments

lon

vector of longitudes

lat

vetor of latitudes

scale

multiplicator. If 1 (default) unit m^2

ellipse

TRUE (polar and equatorial radius differ) or FALSE (default, polar and equatorial radius are the same)

Value

data.table of gridcells with columns c("Lon", "Lat", "area")

Author(s)

Joerg Steinkamp joerg.steinkamp@senckenberg.de

Examples

lon <- seq(- 179.75, 179.75, 0.5)
lat <- seq(89.75,-89.75,-0.5) 
sum(gridarea2d(lon,lat, scale=1.e-12)$area)
sum(gridarea2d(lon,lat, scale=1.e-12, ellipse=TRUE)$area)

MagicForrest/DGVMTools documentation built on Aug. 23, 2024, 8:05 a.m.