midpoint: Geographic midpoint calculation

midpointR Documentation

Geographic midpoint calculation

Description

Calculate the midpoint given a list of locations denoted by latitude and longitude coordinates.

Usage

midpoint(lat, lon, w = rep(1, length(lat)))

Arguments

lat, lon

The location points

w

The weighted value for each point

Value

The geographic midpoint in lat/lon

References

http://www.geomidpoint.com/calculation.html

See Also

radius.of.gyration

Examples

lat <- c(30.2, 30, 30.5)
lon <- c(120, 120.4, 120.5)

# equal weight
midpoint(lat, lon)

# custom weight
w <- c(1, 2, 1)
midpoint(lat, lon, w)


caesar0301/movr documentation built on June 18, 2022, 2:37 a.m.