Area measured in the layer's own projection, which is what sf::st_area() returns and what ArcGIS reports as Shape_Area.

expanse_planar(x, unit = "m")

Arguments

x

A SpatVector, or an object coercible to one via terra::vect().

unit

Character. Output unit, passed to terra::expanse(): one of "m" (the default), "km", "ha".

Value

A numeric vector of areas in unit, one per feature.

Details

terra::expanse() defaults to transform = TRUE, which reprojects to lon/lat and returns geodesic area instead. The two agree in an equal-area projection (e.g. BC Albers) and disagree everywhere else: in Canada Atlas Lambert at BC latitudes geodesic area runs about 2.8% high, which is enough to move features across an area threshold and to shift every reported total. Prefer this wherever an area has to line up with sf, with ArcGIS, or with a fixed cutoff.

For a layer in a geographic (lon/lat) CRS, planar area is meaningless and terra returns geodesic area regardless; this warns in that case.

See also

Examples

v <- terra::vect("POLYGON ((0 0, 100 0, 100 100, 0 100, 0 0))")
terra::crs(v) <- "EPSG:3005"
expanse_planar(v, "m")
#> [1] 10000