geos_nearest: Find the closest feature

Description Usage Arguments Value

View source: R/geos-strtree.R

Description

Finds the closest item index in tree to geom, vectorized along geom.

Usage

1
2
3
4
5
6
7
geos_nearest(geom, tree)

geos_nearest_indexed(geom, tree)

geos_nearest_hausdorff(geom, tree, densify = NULL)

geos_nearest_frechet(geom, tree, densify = NULL)

Arguments

geom

A GEOS geometry vector

tree

A geos_strtree()

densify

A fraction between 0 and 1 denoting the degree to which edges should be subdivided (smaller value means more subdivisions). Use NULL to calculate the distance as-is.

Value

An integer vector of length geom containing the index of tree that is closest to each feature in geom.


geos documentation built on Jan. 13, 2021, 8:13 a.m.