Learn R Programming

stplanr (version 0.2.8)

overline2: Overlay duplicated lines

Description

Overlay duplicated lines

Usage

overline2(x, attrib, ncores = 1, simplify = TRUE,
  regionalise = 10000)

Arguments

x

SF data frame of linestrings

attrib

character, column name to be summed

ncores

integer, how many cores to use in parallel processing

simplify,

logical, if TRUE group final segments back into lines

regionalise,

integer, during simplification regonalisation is used if the number of segments exceeds this value

See Also

Other rnet: SpatialLinesNetwork, calc_catchment_sum, calc_catchment, calc_moving_catchment, calc_network_catchment, find_network_nodes, gsection, islines, lineLabels, overline, plot,SpatialLinesNetwork,ANY-method, plot,sfNetwork,ANY-method, sln2points, sum_network_links, sum_network_routes

Examples

Run this code
# NOT RUN {
sl = routes_fast_sf[routes_fast_sf$length > 0, ]
sl$bicycle = 1
system.time({rnet1 = overline2(sl, "bicycle")})
system.time({rnet2 = overline2(sl, "bicycle", ncores = 4)})
identical(rnet1, rnet2)
lwd = rnet1$bicycle / mean(rnet1$bicycle)
plot(rnet1, lwd = lwd)
# }
# NOT RUN {
region = "isle-of-wight"

u = paste0(
  "https://github.com/npct/pct-outputs-regional-notR/raw/master/commute/msoa/",
   region,
  "/rf.geojson"
)

sl = sf::read_sf(u)
system.time({rnet1 = overline2(sl, "bicycle")})
system.time({rnet2 = overline2(sl, "bicycle", ncores = 4)})
identical(rnet1, rnet2)
lwd = rnet1$bicycle / mean(rnet1$bicycle)
plot(rnet1, lwd = lwd)
# }

Run the code above in your browser using DataLab