bringFeatureToOSM: Choose points on OSM feature which correspond to point on...

Description Usage Arguments Value Examples

View source: R/matchGPXtoNearbyOSM.R

Description

Calculates the closest distance between a feature (e.g. OSM lines) and a feature list (points of tracks). Depending on the distance's threshold, either the closest point on the OSM linestring is chosen or the point of the track is taken if no OSM feature is close enough. The function returns a track matched to the OSM features. The track is returned in crs EPSG:4326.

Usage

1
bringFeatureToOSM(track, osm_features, threshold)

Arguments

track

List of trajectory

osm_features

List of OpenStreetMap features

threshold

Distance threshold in meters.s

Value

Closest distance between x and y.

Examples

1
2
3
4
5
6
7
 ## Not run: 
track = readGPXFile("./inst/extdata/track_run.gpx")
bbox <- st_bbox(track)
osm_features = readOSMFiles(bbox, c("tertiary, secondary, sidewalk, footway"))
osm_track = bringFeatureToOSM(track, osm_features, 10)

## End(Not run)

KathHv/ross documentation built on Dec. 18, 2021, 2:42 a.m.