geo.PointsAlongLines | R Documentation |
Generate points along lines. Following a geometrical line, it produces points based on a factor.
geo.PointsAlongLines(inroads, thefactor)
inroads |
A |
thefactor |
A general multiplier factor which determines the number of points to be generated along the line. |
This function generates a number of points along lines.
A SpatialPointsDataFrame()
object which holds the generated points.
Dimitris Kavroudakis dimitris123@gmail.com
library(goal)
library(sp)
library(rgeos)
x = c(1,2,2,1,1,1,3,3)
y = c(1,3,4,7,8,9,13,21)
thefactor=2
road = sp::SpatialLines(list(sp::Lines(Line(cbind(x,y)), ID="a")))
result = goal::geo.PointsAlongLines(road, thefactor = thefactor)
plot(road)
plot(result, add=TRUE)
result2 = goal::geo.PointsAlongLines(road, thefactor = 1)
plot(road)
plot(result2, add=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.