Re: [R] Geographic distance between lat-long points in R?

From: Scott Chamberlain <scttchamberlain4_at_gmail.com>
Date: Mon, 11 Apr 2011 15:54:12 -0500

Thanks very much for the help!

Scott
On Monday, April 11, 2011 at 12:54 PM, Seeliger.Curt_at_epamail.epa.gov wrote:
> I have a bunch of geographic locations specified by lat-long
> > coordinates. What's an easy way to calculate geographic distance
> > between any two points? OR, perhaps there is a function for
> > calculating a distance matrix for K sites?
>
> A comparison of some geographic distance calculations is provided at
>
http://pineda-krch.com/2010/11/23/great-circle-distance-calculations-in-r/
> , along with code for calculating the Vincenty inverse formula, which
> relies on the WGS-84 ellipsoid approximations.
>
> The author compares the results to fields::rdist.earth, which seems to
> rely on a spherical model of the earth. It would be interesting to
> compare it to other distance functions as well.
>
> I found that the function provided at the above URL did not handle the
> case of coincident points. Adding the following line after the while loop
> fixed this.
> if (iterLimit==100) return(0) # formula began with nearly or
> exactly coincident points
>
> Enjoy the days,
> cur
> --
> Curt Seeliger, Data Ranger
> Raytheon Information Services - Contractor to ORD
> seeliger.curt_at_epa.gov
> 541/754-4638
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 11 Apr 2011 - 20:58:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 11 Apr 2011 - 21:00:29 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive