# NOT RUN {
data(routes_fast)
data(cents)
rnet <- overline(sldf = routes_fast[1:7,], attrib = "length")
plot(rnet)
points(cents)
lineLabels(sldf = rnet, "length")
sum(routes_fast$length[1:7], na.rm = TRUE) # verify highest flow
data(flowlines)
plot(flowlines)
aggflow <- overline(flowlines, attrib = "All")
nrow(aggflow)
aggflow2 <- overline(flowlines, attrib = "All", na.zero = TRUE)
plot(aggflow2) # 8 lines
sel <- as.logical(colSums(gEquals(flowlines, aggflow2, byid = TRUE)))
flowlines_sub <- flowlines[!sel,]
plot(flowlines_sub)
flowlines_2way <- flowlines[sel,]
library(maptools)
flowlines_2way <- spChFIDs(flowlines_2way, as.character(100001:(nrow(flowlines_2way) + 100000)))
flowlines_1way <- raster::bind(flowlines_sub, flowlines_2way)
overlaps <- over()
nrow(overlaps)
routes_fast$group = rep(1:3, length.out = nrow(routes_fast))
rnet_grouped = overline(routes_fast, attrib = "length", byvars = "group")
plot(rnet_grouped, col = rnet_grouped$group, lwd =
rnet_grouped$length / mean(rnet_grouped$length) * 3)
# }
Run the code above in your browser using DataLab