Skip to contents

Create a set of number of evenly spaced points along a line geometry

Usage

points_along_line(line, n_points = 1000)

Arguments

line

The line to create points along. Must be an sfc object (as created by sf::st_sfc()) with LINESTRING geometry.

n_points

The number of points along the line to create.

Value

An sfc object with POINT geometry of length n_points.

Examples

if (FALSE) { # rlang::is_interactive()
dem <- system.file("elevation.tiff", package = "rrrem")
centerline <- get_river_centerline(dem)
center_points <- points_along_line(centerline, n_points = n_points)
}