Learn R Programming

gtfs2gps (version 1.4-0)

cpp_snap_points: Snap points to the closest points from another set

Description

Snap a set of points to the closest points available in another set of points.

Usage

cpp_snap_points(data, ref, spatial_resolution)

Arguments

data

A set of points to be snapped (a matrix). The result will have the same number of rows of this argument. Each row will return the respective snapped point.

ref

A set of reference points (another matrix). The result will be a subset of this parameter.

spatial_resolution

The spatial resolution of data, which means that from each point of data it is possible to reach at least one point within data with distance equals or less than spatial_resolution.

Value

A data.frame with the snapped points.