SPTools is a package to create, edit and convert spatial objects of the package "sp".
Then install SPTools using the
install_github function in the
splitLines splits each single line contained in a SpatialLines object into segments of a specific length.
library("sptools") c1 = cbind(c(0,2,5,7), c(0,2,3,3)) l1 = Line(c1) sl = list(Lines(list(l1), ID = 1)) SP = SpatialLines(sl) plot(SP) SPs = splitLines(SP, 0.4, plot.results = T)
linedf2SpatialLines converts a dataframe with IDs and coordinates into a SpatialLines object. SpatialLines2df performes the reverse operation, extracting the coordinates and IDs of each lines of a SpatialLines object and put into a dataframe. createBox and createCircle create a rectangle and a polygon approximating a circle in the form of a SpatialPolygons object.
The SPTools package as a whole is distributed under [GPL-3 (GNU General Public License version 3)[http://www.gnu.org/licenses/gpl-3.0.en.html].
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.