Dear list, I am using the package geoRglm to do some predictive mapping. There is a function that calculates the distance between observed data points and the prediction locations using a .C call to a function which eventually calculates the length of the hypotenuse between one location and the other given the vertical and horizontal separation distance of those points. My question is, is this method of distance-finding incompatible with long-lat style coordinates? Should I first transform my data and prediction locations into something where the unit of measurement is in metres rather than decimal degrees? Many thanks, Simon
Distance between two points
2 messages · O'Hanlon, Simon J, Sarah Goslee
Precisely. You should use great-circle distances with lat-lon coordinates, rather than Euclidean distance, because the actual length varies with position on the globe. Converting to UTM or something similar is one solution if your points are not too far apart. There are many other R solutions: searching for "great circle distance" at rseek.org will get you quite a list. Sarah On Fri, Dec 7, 2012 at 8:10 AM, O'Hanlon, Simon J
<simon.ohanlon at imperial.ac.uk> wrote:
Dear list, I am using the package geoRglm to do some predictive mapping. There is a function that calculates the distance between observed data points and the prediction locations using a .C call to a function which eventually calculates the length of the hypotenuse between one location and the other given the vertical and horizontal separation distance of those points. My question is, is this method of distance-finding incompatible with long-lat style coordinates? Should I first transform my data and prediction locations into something where the unit of measurement is in metres rather than decimal degrees? Many thanks, Simon
-- Sarah Goslee http://www.functionaldiversity.org