Dear Researchers,

I am doing a Cross Invetory from random point. I wish to convert from points
in a cross (this is a forestry inventory tools) for calculate the linera
elements in my study area. I did all part but I am reading how I can convert
my list in a Line shapefile. Every line is in the list that I did with the
followig code. Sorry It's a raw code but I am not a good R users.
I wish another suggestion, if i can ask. It's is possible to rotate the
Cross (random angle or with apposite angle)?

Thanks gianni

library(spatstat)
mywindow <- owin(c(0,3000),c(0,2000))
plot(mywindow)
n.point <- 10
Rdm.tran <- runifpoint(npoints, w=mywindow)
plot(Rdm.tran, Add=T)
Rdm.tran.xy <- data.frame(Rdm.tran$x,Rdm.tran$y)
xy.point <- as.matrix(Rdm.tran.xy)

lineOr = list()
lineVer = list()
for(i in 1:nrow(xy.point)) {
               # Create a square
            disc =  disc(radius=20, centre=xy.point[i,], npoly=4)
            # extract x coord (first) and y coord (after) of polygon (here
126 because there are 126 points
            xx = disc$bdry[[1]]$x
            yy = disc$bdry[[1]]$y
            # merge x and y coord
            z = data.frame(cbind(xx, yy))
            # select "x" max and "y" max
            line1 <- data.frame(z[z$xx == max(z$xx)| z$xx == min(z$xx),])
            line2 <- data.frame(z[z$yy == max(z$yy)| z$yy == min(z$yy),])
            # import id, xx and yy value in the list
               lineOr[[i]] = rbind(line1)
            lineVer[[i]]=rbind(line2)
}

line.tot <- union(lineOr,lineVer)
line.tot

	[[alternative HTML version deleted]]

