Hi, Has anyone got any R code (or are there any packages) that calculates the great circle distance between two geographical (lat, lon) positions? Cheers Toby Patterson Pelagic Ecosystems Research Group CSIRO Marine Research Email: Toby.Patterson at csiro.au
Have you seen "Online calculations & Downloadable spreadsheets to perform Geodetic Calculations." at http://www.ga.gov.au/nmd/geodesy/datums/calcs.jsp ? Duncan ***************************************** Dr. Duncan Mackay School of Biological Sciences Flinders University GPO Box 2100 Adelaide S.A. 5001 AUSTRALIA Ph (08) 8201 2627 FAX (08) 8201 3015 http://www.scieng.flinders.edu.au/biology/people/mackay_d/index.html -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Toby.Patterson at csiro.au Sent: Wednesday, 26 November 2003 2:55 PM To: r-help at stat.math.ethz.ch Subject: [R] Calculating great circle distances Hi, Has anyone got any R code (or are there any packages) that calculates the great circle distance between two geographical (lat, lon) positions? Cheers Toby Patterson Pelagic Ecosystems Research Group CSIRO Marine Research Email: Toby.Patterson at csiro.au ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Wed, 26 Nov 2003 Toby.Patterson at csiro.au wrote:> Hi, > Has anyone got any R code (or are there any packages) that calculates > the great circle distance between two geographical (lat, lon) positions? >Yes, there is R code in fields, function rdist.earth() taking vectors as arguments for one solution, alternatively there is a C function in spdep: void gcdist(double *lon1, double *lon2, double *lat1, double *lat2, double *dist) which needs to be put in a loop, but is specifically WGS84, and is based on the implementation at: http://home.att.net/~srschmitt/greatcircle.html There may be other code too. Roger> > Cheers > > Toby Patterson > Pelagic Ecosystems Research Group > CSIRO Marine Research > Email: Toby.Patterson at csiro.au > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help >-- Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: Roger.Bivand at nhh.no