Hello all:
I wish to place sampling plots at regular elevation intervals up a mountain.
Plot centers should be placed at random within a 100 m wide transect along
the contour. Can anyone suggest an efficient way of doing this? Code below
places plots on a single transect on the volcano dataset, but does not do
the 'along the contour' randomization.
Appreciatively, Seth Bigelow
library(sp)
library(maptools)
library(rgeos)
data(volcano)
v.sldf <- ContourLines2SLDF(contourLines(volcano))
t.mtx <- cbind(x=c(1,0.35),y=c(0,0.55))
t.sl <- SpatialLines(list(Lines(Line(t.mtx), ID='1')))
sample.sp <- gIntersection(v.sldf,t.sl)
plot(v.sldf, axes=TRUE)
plot(sample.sp, pch=21,add=T)
## End ##
[[alternative HTML version deleted]]
_______________________________________________
R-sig-Geo mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo