Get OSM routes that match shapes, based on geometrical match
Source:R/query_osm_shapes_match_routes.R
osm_shapes_match_routes.Rd
Get OSM routes that match shapes, based on geometrical match
Usage
osm_shapes_match_routes(
gtfs,
q,
geometry = TRUE,
gtfs_match = "route_short_name",
osm_match = "ref"
)
Arguments
- gtfs
tidygtfs. GTFS feed.
- q
osmdata::opq. Overpass query for transit network
- geometry
Boolean (Default TRUE). If TRUE, returns sf object with geometry, otherwise, a simple data.frame.
- gtfs_match
String (Default route_short_name). routes.txt attribute that identifies routes. Accepted values: route_id, route_short_name, route_long_name.
- osm_match
String (Default ref). OSM attribute that identifies routes by matching with gtfs_match. Accepted values: ref, name, gtfs:route_id.
Value
A data.frame
(sf
if geometry=TRUE
) with the following columns:
shape_id
, theshape_id
attribute fromshapes.txt
file.osm_id
, theosm_id
attribute from OSM route relation.distance_diff
, the difference, in meters, between GTFS shape and OSM route lengths.points_diff
, the sum of the difference, in meters, between GTFS shape and OSM route start and end points.route_short_name
, theroute_short_name
attribute fromroutes.txt
file.route_long_name
, theroute_long_name
attribute fromroutes.txt
file.geometry
, the geometrical data for the OSM route relation.