Hi,

You could create the spatialpolygons from scratch using this example:
http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/sp/html/SpatialPolygons-class.html

I noticed you tried to create an alphahull object. Maybe you should have a
look at this code published by Barry Rowlingson:
http://rpubs.com/geospacedman/alphasimple

Also, you've got the rgeos readWKT function to create geometries from Well
Known Text Geometry coordinates.

Best,

Mathieu


2013/2/11 Gustaf Granath <gustaf.granath@gmail.com>

> Hi,
> I have mapped structures with a GPS (walked along their edges) and Im now
> trying to make polygons from my coordinates. The GPS data are a bit fuzzy
> and I want to establish the edge of the structure with a smoother or
> similar. However, I have not been able to find an easy way to do this in R.
> This seems odd to me and I might have missed something. I have so far tried
> doing lines with spline (xspline) or polygons with the alphahull package,
> but they are tricky to work with (usually overfit).   Any pointers are
> welcome.
>
> Gustaf
>
>
> Example code, testing the alphahull package:
> require(alphahull)
> set.seed(1)
> xx <-c(1:10,8,5,2)
> xx <- xx + rnorm(39,0,0.4)
> yy <-c(1:5,5:1,1,1,1)
> yy <-yy + rnorm(39,0,0.4)
> plot( xx ~ yy)
> xy <-data.frame("x" = xx, "y" = yy)
> coords <- coordinates(xy)
>
> # alpha-shape
> x.as <- ashape(coords, alpha=5)
>
> # alpha-hull
> x.ah <- ahull(coords, alpha=5)
>
> #plot
> plot(x.as)
> plot(x.ah)
>
> --
> Gustaf Granath (PhD)
> Post doc
> McMaster University
> Email: gustaf.granath@gmail.com
>
> ______________________________**_________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>

	[[alternative HTML version deleted]]

