# geos_measures: Compute geometric measurements In sf: Simple Features for R

## Description

Compute Euclidian or great circle distance between pairs of geometries; compute, the area or the length of a set of geometries.

## Usage

 1 2 3 4 5 6 7 st_area(x, ...) st_length(x) st_distance(x, y, ..., dist_fun, by_element = FALSE, which = ifelse(isTRUE(st_is_longlat(x)), "Great Circle", "Euclidean"), par = 0, tolerance = 0)

## Arguments

 x object of class sf, sfc or sfg ... ignored y object of class sf, sfc or sfg, defaults to x dist_fun deprecated by_element logical; if TRUE, return a vector with distance between the first elements of x and y, the second, etc. if FALSE, return the dense matrix with all pairwise distances. which character; for Cartesian coordinates only: one of Euclidian, Haussdorf or Frechet; for geodetic coordinates, great circle distances are computed; see details par for which equal to Haussdorf or Frechet, optionally use a value between 0 and 1 to densify the geometry tolerance ignored if st_is_longlat(x) is FALSE; otherwise, if set to a positive value, the first distance smaller than tolerance will be returned, and true distance may be smaller; this may speed up computation. In meters, or a units object convertible to meters.

## Details

great circle distance calculations use function geod_inverse from PROJ; see Karney, Charles FF, 2013, Algorithms for geodesics, Journal of Geodesy 87(1), 43–55

## Value

If the coordinate reference system of x was set, these functions return values with unit of measurement; see set_units.

st_area returns the area of a geometry, in the coordinate reference system used; in case x is in degrees longitude/latitude, st_geod_area is used for area calculation.

st_length returns the length of a LINESTRING or MULTILINESTRING geometry, using the coordinate reference system. POINT, MULTIPOINT, POLYGON or MULTIPOLYGON geometries return zero.

If by_element is FALSE st_distance returns a dense numeric matrix of dimension length(x) by length(y); otherwise it returns a numeric vector of length x or y, the shorter one being recycled. Distances involving empty geometries are NA.