geo.PointsAlongLines: Points Along Lines

View source: R/geometry.r

geo.PointsAlongLinesR Documentation

Points Along Lines

Description

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

Usage

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.

Details

This function generates a number of points along lines.

Value

A SpatialPointsDataFrame() object which holds the generated points.

Author(s)

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)


dimitrisk/goal documentation built on April 15, 2024, 11:04 a.m.