powered by
Get the great circle distance between WGS84 lat/long points
get_gcdist(pt1 = NULL, pt2 = NULL, units = c("m", "km", "rads"), simple = TRUE)
Numeric vector of point to point distances, or data frame of origin and destination coordinates accompanied by their distances.
`sf` object with point geometry, `sfc_POINT` object, `sfg` point, data frame or matrix.
whether to return the great circle distance in meters, kilometers, or radians.
whether to return a numeric vector of distances or a `data.frame` containing start and end coordinates as well as distance.
# distance between Brisbane and Melbourne bne <- c(153.028, -27.468) mlb <- c(144.963, -37.814) get_gcdist(bne, mlb, 'km')
Run the code above in your browser using DataLab