distanceCaculate: caculate distance

Description Usage Arguments Details Examples

Description

caculate the spherical distance between 2 point on earth

Usage

1
distanceCaculate(lon_1, lat_1, lon_2, lat_2, r = 6378137)

Arguments

lon_1, lon_2

numeric, degree longitude

lat_1, lat_2

numeric, degree latitude

r

earth radius from geosphere package

Details

although geosphere::distHaversine can caculate the spherical distance, distanceCaculate is about 20X-30X faster than that, and only has error less than 0.2%.

Examples

1
distanceCaculate(108.8821, 34.2341, 108.882, 34.2343)

ashther/ashtheR documentation built on May 27, 2019, 11:49 p.m.