I came across R function -alphahull- and believe it is the best option to turn gps points into a polygon (3 or 4 days worth of gps points across residence/neighborhood for each of 300 subjects). However, I am just starting to use R and I would appreciate any help with removing duplicate points, as I am getting the following error: "Error in tri.mesh(X) : duplicate data points" after running:
library(sp)
library(alphahull)
library(maptools)
#define projection
project2<-"+proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
# read point shapefile
data.shape <- readShapePoints("D:/clayera/UWO/msthesistake2/tesisGIS/D1001_GPS_WalkExtSel.shp",proj4string=CRS(project2))
plot(data.shape)
summary(data.shape)
# extract coordinates
x.coords <- coordinates(data.shape) #this way we get duplicate coordinates
# alpha-shape: 100 meter threshold
x.as <- ashape(x.coords[,1], x.coords[,2], alpha=100)
Apologies for such a basic question and thanks for any comment/help.
data.shapebyreadShapePoints. You can see it in the output ofsummary, for instance. – whuber♦ Oct 10 '12 at 19:14