An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130516/84267b1d/attachment.pl>
nearest neighbour using distance in metres
3 messages · Ross Ahmed, Matteo Mattiuzzi, Hugh Sturrock
Dear Ross, Euclidean Distance is not an units, it is a type of distance measurement an it is always in input units! The Euclidean Distance is the length of a rope between your hands that you hold strained, but see here: http://en.wikipedia.org/wiki/Euclidean_distance nndist(xySpatialTransformed at coords) and maybe it is not very meaningful to calculate nndist with something else than a planar coordinate system... or even equidistant coordinate system! (but I'm not a cartographer) Matteo
Ross Ahmed 05/16/13 3:14 PM >>>
Hi all,
Following code computes Euclidian distance from each point to it nearest
neighbour:
library(spatstat)
y <- rnorm(30, 55.65, .008)
x <- rnorm(30, -1.82, .01)
xy <- cbind(x, y)
nndist(xy)
Is it possible to use distance in metres, not Euclidian distances? Here are
same points projected:
xySpatial <- SpatialPoints(xy, proj4string= CRS("+proj=longlat +datum=WGS84
+ellps=WGS84 +towgs84=0,0,0"))
xySpatialTransformed <- spTransform(xySpatial, CRS("+proj=laea +lon_0=-1.92
+lat_0=55.7 +datum=WGS84"))
Thanks
Ross
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo at r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130516/5d019b49/attachment.pl>