Learn R Programming

stplanr (version 0.1.4)

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
## Not run: 
# 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
# ## End(Not run)

Run the code above in your browser using DataLab