lixelize_lines.mc: Cut lines into lixels (multicore)

View source: R/geometrical_functions_sf.R

lixelize_lines.mcR Documentation

Cut lines into lixels (multicore)

Description

Cut the lines of a feature collection of linestrings into lixels with a specified minimal distance may fail if the line geometries are self intersecting with multicore support.

Usage

lixelize_lines.mc(
  lines,
  lx_length,
  mindist = NULL,
  verbose = TRUE,
  chunk_size = 100
)

Arguments

lines

A feature collection of linestrings to convert to lixels

lx_length

The length of a lixel

mindist

The minimum length of a lixel. After cut, if the length of the final lixel is shorter than the minimum distance, then it is added to the previous lixel. If NULL, then mindist = maxdist/10

verbose

A Boolean indicating if a progress bar must be displayed

chunk_size

The size of a chunk used for multiprocessing. Default is 100.

Value

A feature collection of linestrings

Examples


data(mtl_network)
future::plan(future::multisession(workers=1))
lixels <- lixelize_lines.mc(mtl_network,150,50)
## make sure any open connections are closed afterward
if (!inherits(future::plan(), "sequential")){
future::plan(future::sequential)
}


JeremyGelb/spNetwork documentation built on May 24, 2024, 7:23 p.m.