powered by
Calculates the fraction of a LineString's length to a point that is closes to a corresponding point in y.
y
locate_point_on_line(x, y)
A numeric vector containing the fraction of of the LineString that would need to be traveled to reach the closest point.
an object of class rs_LINESTRING
rs_LINESTRING
an object of class rs_POINT
rs_POINT
x <- geom_linestring(c(-1, 0, 0), c(0, 0, 1)) y <- geom_point(-0.5, 0) locate_point_on_line(x, y)
Run the code above in your browser using DataLab