Skip to content

Matrix of distances (km) between Coordinates

4 messages · Angelo Moreno, Marcelino de la Cruz, Barry Rowlingson +1 more

#
Hi, I have a list of corrdinates (latitude, longitude), I need to calculate
the distance between each coordinate, and generate a matrix,  How could I
try to do it? Thanks.

--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Matrix-of-distances-km-between-Coordinates-tp6382641p6382641.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
#
as.matrix(dist(corrdinates))
On 19/05/2011 18:08, Angelo Moreno wrote:

  
    
#
2011/5/19 Marcelino de la Cruz <marcelino.delacruz at upm.es>:
For small distances near the equator yes! Don't try this if you are
studying polar bears!

 Try rdist.earth in the 'fields' package, or try transforming to a
euclidean coordinate system using spTransform before using dist.

Barry
#
?spDists in package sp, with argument longlat = TRUE.
On 05/19/2011 06:46 PM, Barry Rowlingson wrote: