Re: [R] Midpoint between coordinates

2010-07-23 Thread Mafalda Viana
Dear David and R users, Thank you very much for the help. There is a function in the suggested package called "midPoint" which does what I need. df<- data.frame(lon1=c(-4.568,-4.3980), lat1=c(59.235,56.369), lon2=c(-5.123,-4.698), lat2=c(60.258,59.197) ) library(geosphere) p1 <- matrix(c(df$lo

Re: [R] Midpoint between coordinates

2010-07-23 Thread David Winsemius
On Jul 23, 2010, at 8:58 AM, Mafalda Viana wrote: The arithmetic mean was my first approach and to nearby points it doesn't make much difference. However, when the distance between the 2 points gets bigger this is no longer accurate enough. So yes, I was thinking on spherical geometry, midpoint

Re: [R] Midpoint between coordinates

2010-07-23 Thread Mafalda Viana
The arithmetic mean was my first approach and to nearby points it doesn't make much difference. However, when the distance between the 2 points gets bigger this is no longer accurate enough. So yes, I was thinking on spherical geometry, midpoint considering the great circle distance or similar. Th

Re: [R] Midpoint between coordinates

2010-07-23 Thread David Winsemius
On Jul 23, 2010, at 7:13 AM, Mafalda Viana wrote: Dear R users, I need to find the coordinates for the point (midpoint) located half way between two pairs of coordinates (lon1,lat1 and lon2,lat2) assuming a straight line between them. What would be the best way? I tried to find an answer in th