[R-sig-Geo] Best way to calculate distance between geographical points

Robert J. Hijmans r.hijmans at gmail.com
Thu Jan 14 19:17:12 CET 2010


In the geosphere package on R-Forge there are a number of distance
functions (from law of cosines to more complex) as well as related
spherical trig functions, such as computing paths along a
great-circle. There is also pointDistance in the raster package.

Robert

On Thu, Jan 14, 2010 at 1:27 AM, Karl Ove Hufthammer <karl at huftis.org> wrote:
> Dear list members
>
> I have found three functions for calculating the distance between
> geographical points, 'geo.dist' in the 'oce' package, 'rdist.earth' in
> the 'fields' package, and 'spDistsN1' in the 'sp' package. They all give
> slightly difference answers, so my question is: which of them is best,
> i.e., gives the most accurate answer?
>
> When it comes to performance, the 'rbenchmark' package shows that (at
> least on calculating a single distance), 'spDistsN1' is the fastest,
> 'geo.dist' takes twice as long, and 'rdist.earth' takes about five times
> as long (as 'spDistsN1').
>
> --
> Karl Ove Hufthammer
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list