nearest_lines: Nearest line for points

View source: R/geometrical_functions_sf.R

nearest_linesR Documentation

Nearest line for points

Description

Find for each point its nearest LineString

Usage

nearest_lines(points, lines, snap_dist = 300, max_iter = 10)

Arguments

points

A feature collection of points

lines

A feature collection of linestrings

snap_dist

A distance (float) given to find for each point its nearest line in a spatial index. A too big value will produce unnecessary distance calculations and a too short value will lead to more iterations to find neighbours. In extrem cases, a too short value could lead to points not associated with lines (index = -1).

max_iter

An integer indicating how many iteration the search algorithm must perform in the spatial index to find lines close to a point. At each iteration, the snap_dist is doubled to find candidates.

Examples

# this is an internal function, no example provided

JeremyGelb/spNetwork documentation built on May 24, 2024, 7:23 p.m.