[R-sig-Geo] dividing a line by points lying on it

Wolfgang Biener wolfgang.biener at ise.fraunhofer.de
Thu Mar 26 12:24:49 CET 2015


Hi there,

I want to divide a line into n+1 lines. The shall be divided by points 
lying on it.
Since I don't have any idea how to solve can also post the starting 
point of the problem.

Thanks for your Help


library(sp)
Sl = SpatialLines(list(Lines(list(Line(cbind(c(1,2,2),c(1,1,2)))),
                              ID="a")))

set.seed(123)
sample.points <- spsample(Sl, 10, type="regular")

x11()
plot(Sl)
plot(sample.points, pch=1, col="red", add=T)

-- 
Wolfgang Biener,
Division Electrical Energy Systems
Fraunhofer-Institut für Solare Energiesysteme ISE
Heidenhofstrasse 2, 79110 Freiburg, Germany

Phone: +49 (0) 7 61/ 45 88-5893
wolfgang.biener at ise.fraunhofer.de
http://www.ise.fraunhofer.de



More information about the R-sig-Geo mailing list