network_knn_worker: worker function for K-nearest points on network

View source: R/knn_sf.R

network_knn_workerR Documentation

worker function for K-nearest points on network

Description

The worker the K-nearest points for a set of points on a network.

Usage

network_knn_worker(
  points,
  lines,
  k,
  direction = NULL,
  use_dest = FALSE,
  verbose = verbose,
  digits = digits,
  tol = tol
)

Arguments

points

A feature collection of points, for each point, its k nearest neighbours will be found on the network.

lines

A feature collection of lines representing the network

k

An integer indicating the number of neighbours to find..

direction

Indicates a field providing information about authorized travelling direction on lines. if NULL, then all lines can be used in both directions. Must be the name of a column otherwise. The values of the column must be "FT" (From - To), "TF" (To - From) or "Both".

use_dest

A boolean indicating if the origins and separations are separated (TRUE), FALSE if only origins are used.

verbose

A Boolean indicating if the function should print its progress

digits

The number of digits to retain in the spatial coordinates ( simplification used to reduce risk of topological error)

tol

A float indicating the spatial tolerance when points are added as vertices to lines.

Value

A list with two matrices, one with the index of the neighbours and one with the distances.

Examples

#no example provided, this is an internal function

spNetwork documentation built on Aug. 24, 2023, 5:10 p.m.