Calculates the distance between two data-Points in degress, radians, miles, or kilometers. Uses the Haversine formula to account for global curvature.

lawn_distance(from, to, units = "kilometers", lint = FALSE)

Arguments

from

Origin data-Feature<(data-Point)>

to

Destination data-Feature<(data-Point)>

units

(character) Can be degrees, radians, miles, or kilometers (default).

lint

(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Value

Single numeric value

See also

Examples

from <- '{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [-75.343, 39.984] } }' to <- '{ "type": "Feature", "properties": {}, "geometry": { "type": "Point", "coordinates": [-75.534, 39.123] } }' lawn_distance(from, to)
#> [1] 97.15958