Learn R Programming

SDraw (version 2.1.13)

polygonArea: Polygon area

Description

An all-R routine that computes area of all polygons in a SpatialPolygons* object, taking account of holes.

Usage

polygonArea(x)

Arguments

x

A spatial object inheriting from SpatialPolygons

Value

Area of all polygons in x, taking account of holes. Units of area are squared units of coordinates in x. E.g., square meters if coordinates in x are UTM meters, square decimal degrees if coordinates in x are lat-long decimal degrees.

Details

Provides the same answer as rgeos::gArea, but is all-R (does not require rgeos Java library) and does not fire a warning if x is un-projected (i.e., lat-long).

See Also

sp::SpatialPolygons-class

Examples

Run this code
# NOT RUN {
# Area of Washington state, in hectares
a <- polygonArea( WA ) / (100*100)

# }

Run the code above in your browser using DataLab