Learn R Programming

stplanr (version 0.0.2)

gsection: Function to split overlapping SpatialLines into segments

Description

Divides SpatialLinesDataFrame objects into separate Lines. Each new Lines object is the aggregate of a single number of aggregated lines.

Usage

gsection(sl)

Arguments

sl
SpatialLinesDataFrame with overlapping Lines to split by number of overlapping features.

Examples

Run this code
data(routes_fast)
rsec <- gsection(routes_fast)
plot(routes_fast)
lines(rsec, col = "red", lwd = 3)
length(rsec)
set.seed(5)
sel <- sample(length(rsec), 20)
plot(rsec[sel,], col = "blue", add = TRUE, lwd = 3) # overlapping lines

Run the code above in your browser using DataLab