powered by
For a given geometry, find the closest point on that geometry to a point. The closest point may be an intersection, a single point, or unable to be determined.
closest_point(x, y)closest_point_haversine(x, y)
closest_point_haversine(x, y)
An rs_POINT vector
rs_POINT
an object of class rsgeo
rsgeo
an object of class rs_POINT
x <- geom_linestring(1:100, runif(100, 0, 90), rep.int(1:10, 10)) y <- geom_point(runif(10, 0, 90), rnorm(10, 1, 90)) closest_point(x, y) closest_point_haversine(x, y)
Run the code above in your browser using DataLab