Learn R Programming

gtfs2gps (version 2.0-2)

cpp_snap_points_nearest1: Snap points to the closest points from another set

Description

Snap a set of points to the closest reference points. It requires that the distance from the data points to the reference points should be smaller than the spatial resolution.

Usage

cpp_snap_points_nearest1(data, ref, spatial_resolution)

Value

A data.frame with the snapped points.

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.