st_line_project_point | R Documentation |
Project point on linestring, interpolate along a linestring
st_line_project(line, point, normalized = FALSE)
st_line_interpolate(line, dist, normalized = FALSE)
line |
object of class |
point |
object of class |
normalized |
logical; if |
dist |
numeric, vector with distance value(s) |
arguments line
, point
and dist
are recycled to common length when needed
st_line_project
returns the distance(s) of point(s) along line(s), when projected on the line(s)
st_line_interpolate
returns the point(s) at dist(s), when measured along (interpolated on) the line(s)
st_line_project(st_as_sfc("LINESTRING (0 0, 10 10)"), st_as_sfc(c("POINT (0 0)", "POINT (5 5)")))
st_line_project(st_as_sfc("LINESTRING (0 0, 10 10)"), st_as_sfc("POINT (5 5)"), TRUE)
st_line_interpolate(st_as_sfc("LINESTRING (0 0, 1 1)"), 1)
st_line_interpolate(st_as_sfc("LINESTRING (0 0, 1 1)"), 1, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.