sp_snap_points_to_lines: Function to "snap" spatial points to the nearest spatial...

View source: R/sp_snap_points_to_lines.R

sp_snap_points_to_linesR Documentation

Function to "snap" spatial points to the nearest spatial line.

Description

Function to "snap" spatial points to the nearest spatial line.

Usage

sp_snap_points_to_lines(
  sp_points,
  sp_lines,
  max_distance = NA,
  id = NA,
  rename = TRUE
)

Arguments

sp_points

Spatial points to be snapped.

sp_lines

Spatial lines to snap sp_points to.

max_distance

The maximum distance to avoid snapping points that are farther apart.

id

The variable in sp_lines which will be transferred to sp_points to distinguish the line which each point was snapped to.

rename

Should the id variable be renamed?

Value

Spatial points with altered coordinates; all points will lie on lines supplied for sp_lines.

Author(s)

Stuart K. Grange

See Also

snapPointsToLines


skgrange/gissr documentation built on Feb. 24, 2024, 2:55 p.m.