Skip to content
Prev 7378 / 29559 Next

Best way to calculate distance between geographicalpoints

On Thu, 14 Jan 2010, ONKELINX, Thierry wrote:

            
parameter (which is like the International 1909 ellipsoid, but a sphere). 
geod.dist() is using WGS84 a=6378137.0  rf=298.257223563:

http://code.google.com/p/r-oce/source/browse/trunk/R/misc.R

near line 280. The code under spDistsN1() uses WGS84 values, but with the 
radius in km:

http://r-spatial.cvs.sourceforge.net/viewvc/r-spatial/sp/src/gcdist.c?revision=1.6&view=markup

So in principle geod.dist() and spDistsN1(..., longlat=TRUE) should yield 
equivalent results, because their assumptions are the same.

Several of the references suggest that the geographic pole should not be 
input. It looks as though the oce implementation handles this more 
gracefully than sp.

Hope this helps,

Roger