Learn R Programming

spNetwork (version 0.2.1)

lines_center: Centre points of lines

Description

Generate a SpatialPointsDataFrame with points at the centre of lines. The length of the lines is used to determine its centre.

Usage

lines_center(lines)

Arguments

lines

The SpatialLinesDataframe to use

Value

An object of class SpatialPointsDataFrame (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)
centers <- lines_center(mtl_network)
# }

Run the code above in your browser using DataLab