SpatialLinesMidPoints.Rd
The function onverts SpatialLinesDataFrame to SpatialPointsDataFrame with points at the midpoints of the line segments.
SpatialLinesMidPoints(sldf)
sldf | A SpatialLines or SpatialLinesDataFrame object |
---|
The function builds a SpatialPointsDataFrame from the midpoints of Line objects belonging to Lines objects in an object inheriting from a Spatial Lines object. The output data slot contains an index variable showing which Lines object the midpoints belong to.
A SpatialPointsDataFrame object created from the input object.
Jonathan Callahan, modified by Roger Bivand
xx <- readShapeLines(system.file("shapes/fylk-val.shp", package="maptools")[1], proj4string=CRS("+proj=utm +zone=33 +datum=WGS84"))#> Warning: readShapeLines is deprecated; use rgdal::readOGR or sf::st_readspdf <- SpatialLinesMidPoints(xx)#> Warning: CRS object has comment, which is lost in output