The function can be used to estimate the amount of transport 'flow'
at the route segment level based on input datasets from routing services,
for example linestring geometries created with the route()
function.
The overline()
function breaks each line into many straight segments and then looks for duplicated segments.
Attributes are summed for all duplicated segments, and if simplify is TRUE the segments with identical attributes are
recombined into linestrings.
The following arguments only apply to overline2()
:
ncores
, the number of cores to use in parallel processing
simplify
, should the final segments be converted back into longer lines? The default setting.
regionalise
the threshold number of rows above which regionalisation is used (see details).
For sf
objects
Regionalisation breaks the dataset into a 10 x 10 grid and then performed the simplification across each grid.
This significantly reduces computation time for large datasets, but slightly increases the final file size.
For smaller datasets it increases computation time slightly but reduces memory usage and so may also be useful.
A known limitation of this method is that overlapping segments of different lengths are not aggregated.
This can occur when lines stop halfway down a road. Typically these errors are small,
but some artefacts may remain within the resulting data.
For very large datasets nrow(x) > 1000000, memory usage can be significant. In these cases is is possible
to overline subsets of the dataset, rbind the results together, and then overline again, to produce
a final result.
Multicore support is only enabled for the regionalised simplification stage as it does not help with other stages.