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 and that such distance should be smaller than the distance to the next reference point.
cpp_snap_points_nearest2(data, ref, spatial_resolution)
A data.frame with the snapped points.
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.
A set of reference points (another matrix). The result will be a subset of this parameter.
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.