locate_point_on_line: Locate a Point on a LineString

View source: R/extendr-wrappers.R

locate_point_on_lineR Documentation

Locate a Point on a LineString

Description

Calculates the fraction of a LineString's length to a point that is closes to a corresponding point in y.

Usage

locate_point_on_line(x, y)

Arguments

x

an object of class rs_LINESTRING

y

an object of class rs_POINT

Value

A numeric vector containing the fraction of of the LineString that would need to be traveled to reach the closest point.

Examples

x <- geom_linestring(c(-1, 0, 0), c(0, 0, 1))
y <- geom_point(-0.5, 0)
locate_point_on_line(x, y)

rsgeo documentation built on Sept. 9, 2023, 1:07 a.m.