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

Karl Ove Hufthammer karl at huftis.org
Thu Jan 14 12:47:02 CET 2010


On Thu, 14 Jan 2010 12:27:04 +0100 (CET) Roger Bivand 
<Roger.Bivand at nhh.no> wrote:
> 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,

It does. Thanks.

BTW, is there a reason 'spDistsN1' handle longitude 360 different from 
longitude 0? For example, the distance between 0,0 and 0,0 is 0, but the 
distance between 0,0 and 360,0 is about 1e-12. This is of course not a 
problem; I was just wondering on the reason (since 360,0 is for all 
practical *correctly* handled -- it's just not handled equal to 0,0).

-- 
Karl Ove Hufthammer



More information about the R-sig-Geo mailing list