surface_area: Surface Area

View source: R/surfacearea.R

surface_areaR Documentation

Surface Area

Description

Calculates the scaled surface area of a raster or matrix.

Usage

surface_area(x)

Arguments

x

A raster or matrix.

Details

This function scales both x and y, as well as the surface value (z), to between 0 and 1 to best match their units. This is done because most satellite data have units where the x, y units do not equal the z units. The surface area represents the surface area of the sample area (N-1, M-1).

Note that the surface object may have NA values around the edges, but should not have any missing values within the main area.

Value

A numeric value representing the scaled surface area.

Examples

# import raster image
data(normforest)
normforest <- terra::unwrap(normforest)

# calculate surface area
surface_area(normforest)

geodiv documentation built on Oct. 6, 2023, 1:07 a.m.