Hello R community,
I have cross-posted with r-sig-geo as this issue could fall under
either interest group I believe.
I just came accross the alphahull package and am very pleased I may
not need to use CGAL anymore for this purpose. However, I am having
a problem computing alpha shapes with my point data, and it seems to
have to do with the spatial configuration of my points (which form
long, skinny, contiguous clusters). If I use rnorm to generate the
same sample size with the same mean and SD, I can compute the alpha
shape without trouble (which is why I think it might have to do with
the spatial arrangement of my points). See below:
# first here's a quick sample of my data (UTM coordinates)
[1] 670080.2 670080.2 670080.2 670080.2 670080.2
[1] 5005501 5005499 5005498 5005497 5005495
#try the ashape routine with error
alpha.shape<-ashape(xcoords,ycoords,15)
Error in tri.mesh(X) : error in trmesh
#get statistics to generate a similar dataset to test against
[1] 181.5950
#generate the test data
xtest<-rnorm(26257,670462.4,149.3)
ytest<-rnorm(26257,5005382,181.60)
# try ashape routine with success
alpha.shape<-ashape(xtest,ytest,15)
class(alpha.shape)
[1] "ashape"
Thanks for any insight into this!
Murray
ps I am able to compute the alpha shapes for this same dataset without
problem using CGAL but I find it a pain to work with....