min_dist_to_feature: Computes the minimum distance of locations to the nearest...

Description Usage Arguments Value Examples

View source: R/min_dist_to_feature.R

Description

min_dist_to_feature computes the shortest distance of each location (as identified by locationsTracks) in a Tracks object to the closest polyline or polygon border. It does not include all possible features, but starts looking for features in a certain distance from each location. If no features are found, the search distance is increased iteratively.

Usage

1
min_dist_to_feature(currenttrack, feature, minrange = 10000)

Arguments

currenttrack

A Tracs object usually representing movement of one household. The data slot of currenttrack must contain a variable "location" representing unique IDs for locations. Values with the location 0 receive distance values of NA.

feature

A SpatialLines or SpatialPolygons object containing the features to compute distance to.

minrange

A numerical value > 0 representing the minimum buffer radius within which min_dist_to_feature initially searches for the closest polyline or polygon border around a location. The unit of minrange is the same as for the reference system of currenttrack.

Value

A vector with the shortest distance of all locations in currenttrack to the closest feature in feature. For each value in currenttrack, a distance value will be returned in the order of data values.

Examples

1
#

henningte/herdersTA documentation built on Jan. 22, 2020, 5:16 a.m.