Generate points along lines. Following a geometrical line, it produces points based on a factor.

geo.PointsAlongLines(inroads, thefactor)

Arguments

inroads

A SpatialLines() or SpatialLinesDataFrame() object. The generated points will fall along this line.

thefactor

A general multiplier factor which determines the number of points to be generated along the line.

Value

A SpatialPointsDataFrame() object which holds the generated points.

Details

This function generates a number of points along lines.

Author

Dimitris Kavroudakis dimitris123@gmail.com

Examples

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)