stamp.distance: stamp.distance

View source: R/stamp.distance.r

stamp.distanceR Documentation

stamp.distance

Description

The function stamp.distance can be used to compute various measures of distance between polygon events and groups. In turn, distance measurements can be used to estimate the velocity of polygon movement.

Usage

stamp.distance(stmp, dist.mode = "Centroid", group = FALSE)

Arguments

stmp

a sf object generated from the stamp function.

dist.mode

Character determining the method by which polygon distances are computed. If "Centroid" then the centroid distance is calculated, if "Hausdorff" then the discrete Hausdorff distance is calculated; see Details.

group

logical indicating whether distances should be computed from the T1 polygon to each individual stamp event (group = FALSE – the default), or whether T2 polygons should combined (through a spatial union) in order to compute the measure of distance for each stamp group (group = TRUE)

Details

stamp.distance computes distance between polygon sets based on either centroid or Hausdorff distance calculations. Centroid distance is simply the distance from the centroid of all T1 polygons (combined) to each stamp event (group = FALSE), or to the union of all T2 polygons within a group (group = TRUE), in the second case, all events within a group are given an identical distance value.

The Hausdorff distance calculation uses the Hausdorff distance, as programmed in the function st_distance. A value of par = 0.1 is used to increase the precision of this measurement – see help(st_distance). The returned distance is then the Hausdorff distance of all T1 polygons (combined) to each stamp event (group = FALSE), or to the union of all T2 polygons within a group (group = TRUE), in the second case, all events within a group are given an identical distance value. All distance calculations are computed in meters using the geographical projection WGS84.

Value

Appropriately named columns (e.g., CENDIST or HAUSDIST) in the stamp sf object. Distances are in meters.

References

Hausdorff Distance: https://en.wikipedia.org/wiki/Hausdorff_distance

See Also

stamp stamp.direction


stampr documentation built on April 28, 2023, 1:10 a.m.