Skip to content
Prev 21126 / 29559 Next

Cut SpatialLines into two Lines when intersecting with SpatialPolyon

On Tue, 3 Jun 2014, Wouter Steenbeek wrote:

            
gI <- gIntersection(SpP, Sl, byid=c(TRUE, TRUE))
plot(gI, col=1:4, lwd=2, add=TRUE)
row.names(gI)

The row.names() of the output are predictable, and can be modified by 
modifying the row.names of the input objects.
No, you have to figure this out youself, using the components of the 
row.names of the output object, and ensure that the names of the variables 
in the new data.frame object are unique.

Hope this helps,

Roger