Skip to content
Prev 5997 / 29559 Next

Distribute points along lines

On Fri, 3 Jul 2009, Kamran Safi wrote:

            
Exactly:

library(sp)
data(meuse.riv)
SL <- SpatialLines(list(Lines(list(Line(meuse.riv[1:80,])), ID="1")))
plot(SL)
pts <- spsample(SL, n=50, type="random")
plot(pts, add=TRUE)

Here we only have one Line object in the single Lines object, but the 
principle is the same.

Roger