Learn R Programming

tidytransit (version 0.7.1)

get_trip_geometry: Get all trip shapes for a given route and service.

Description

Get all trip shapes for a given route and service.

Usage

get_trip_geometry(gtfs_sf_obj, trip_ids)

Arguments

gtfs_sf_obj

tidytransit gtfs object with sf data frames

trip_ids

trip_ids to extract shapes

Value

an sf dataframe for gtfs routes with a row/linestring for each trip

Examples

Run this code
# NOT RUN {
data(gtfs_duke)
gtfs_duke <- gtfs_as_sf(gtfs_duke)
trips_sf <- get_trip_geometry(gtfs_duke, c("t_726295_b_19493_tn_41", "t_726295_b_19493_tn_40"))
plot(trips_sf[1,])
# }

Run the code above in your browser using DataLab