[R-sig-Geo] Using distmap from spatstat with latitude and longitude

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Thu Jan 13 11:14:42 CET 2011


On Thu, Jan 13, 2011 at 9:17 AM, Gavan McGrath <gavan.mcgrath at uwa.edu.au> wrote:
> Being new to spatial stats I need help calculating the distance to cyclone paths at continental scales.
> I have a map with pixels at fixed latitude and longitude intervals and cyclone positions as lat and long points.
> Can I use distmap from the spatstat package?

Looks like that will only be happy with euclidean distances. You'll
get an answer in degrees, which will depend on your latitude...

 If you have lat-long data then the distance you probably want is the
great circle distance, for which you can use the 'rdist.earth'
function in the 'fields' package:

-- Description:

     Given two sets of longitude/latitude locations computes the Great
     circle (geographic) distance matrix among all pairings.


 RSiteSearch("great circle") gives some other options for working out
distances on this non-spherical planet on which we live on.

Barry



More information about the R-sig-Geo mailing list