Skip to contents

These functions use the Chamberlain-Duquette formula, which is suitable for geographic coordinates on a sphere. Results are in square meters.

Usage

ga_signed_area_cd(x)

ga_unsigned_area_cd(x)

Arguments

x

a GeoArrow geometry array

Value

a double vector of area values in square meters

Examples

fp <- system.file("shape/nc.shp", package = "sf")
nc <- as.data.frame(read_shapefile(fp))

# square meters, not square degrees
head(as.vector(ga_unsigned_area_cd(nc$geometry)))
#> [1] 1139433024  611704011 1426267143  695828090 1523251541  969518599
head(as.vector(ga_signed_area_cd(nc$geometry)))
#> [1] -1139433024  -611704011 -1426267143  -695828090 -1523251541  -969518599