Skip to content
Prev 25126 / 29559 Next

package sp, extract values points-lines

Hi Roger,

Thanks for the tip. I tried with only one track the function gIntersects
and gbuffer . It works.
I created my spatiallines from a data frame , and now I was looking for how
create the spatiallines by categories (1 variable of the data.frame).
I have only one spatial line with all the coordinates, and I would like to
have 1000 different lines separates by the IdkeyL. It's that possible??


My spatial data frame:
coordinates IdkeyL  Date
1 (-24.54572, 37.30128)  2815L 42229
2 (-24.59933, 37.32453)  2815L 42229
3 (-24.68027, 37.36087)  2815L 42229


I checked the sp and rgeos manual, and I look into the forums, but in every
example they only use a few lines, which are defined one by one.
l1 <- cbind(c(1, 2, 3), c(3, 2, 2)) l2 <- cbind(c(1, 2, 3), c(1, 1.5, 1))
Sl1 <- Line(l1) Sl2 <- Line(l2) S1 <- Lines(list(Sl1), ID = "a") S2 <- Lines
(list(Sl2), ID = "b") Sl <- SpatialLines(list(S1, S2))

Thanks in advance
Marta


2016-11-24 13:12 GMT-01:00 Roger Bivand <Roger.Bivand at nhh.no>: