
Get OSM routes geometry considering gtfs:shape_id match
Source:R/query_osm_shapes_to_routes.R
osm_shapes_to_routes.RdGet OSM routes geometry considering gtfs:shape_id match
Usage
osm_shapes_to_routes(
gtfs,
q,
ways = FALSE,
ways_tags = c("lanes", "psv", "bus", "way")
)Arguments
- gtfs
tidygtfs. GTFS feed.
- q
osmdata::opq. Overpass query for transit network.
- ways
boolean (Default False). If true, relation is disaggregated in ways.
character vector (Default
c("lanes", "psv", "bus", "way")). List of OSM way tags to extract whenwaysparameter is set to true. Match is done usingtidyselect::contains().
Value
A sf data.frame with the following columns:
shape_id, theshape_idattribute fromshapes.txtfile.osm_id, theosm_idattribute from OSM route relation.way_osm_id, theosm_idattribute from OSM way (ifwaysparameter is set to true).*, any column that matchesways_tagsparameter.geometry, the geometrical data for the OSM route relation.
Shapes that do not have a match on OSM are ignored. If that occurs, a warning is displayed during the method execution, informing about the missing geometries.