Testing the simple features R package

Load and look at basics of simple features package library(devtools) # install_github("edzer/sfr") library(sf) ## Linking to GEOS 3.5.0, GDAL 2.1.1, proj.4 4.9.3 nc <- st_read(system.file("shape/nc.shp", package="sf")) ## Reading layer `nc' from data source `C:\Users\mweber\R\library\sf\shape\nc.shp' using driver `ESRI Shapefile' ## converted into: MULTIPOLYGON ## Simple feature collection with 100 features and 14 fields ## geometry type: MULTIPOLYGON ## dimension: XY ## bbox: xmin: -84.32385 ymin: 33.88199 xmax: -75. [Read More]

R extract line endpoints

Extracting line end nodes in R

I noticed the maptools package in R had a SpatialLinesMidPoints function but couldn’t find any other out of the box functions in any packages to extract line endpoints. So I modified SpatialLinesMidPoints slightly to do the job: