spNetwork (version 0.1.1)

lixelize_lines: Cut lines into lixels

Description

Cut a SpatialLines object into lixels with a specified minimal distance may fail if the lines geometries are self intersecting.

Usage

lixelize_lines(lines, lx_length, mindist = NULL, verbose = FALSE)

Arguments

lines

The SpatialLinesDataframe to modify

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. Note that the segments that are already shorter than the minimum distance are not modified.

verbose

A Boolean indicating if a progress bar should be displayed

Value

An object of class SpatialLinesDataFrame (package sp)

Examples

Run this code
# NOT RUN {
networkgpkg <- system.file("extdata", "networks.gpkg", package = "spNetwork", mustWork = TRUE)
mtl_network <- rgdal::readOGR(networkgpkg,layer="mtl_network", verbose=FALSE)
lixels <- lixelize_lines(mtl_network,150,50)
# }

Run the code above in your browser using DataCamp Workspace