I am trying to access the real-time position of a bus from the GTFS data. I have followed the examples from here but the sample is different than the source I am looking to access. The transit provider I am looking to access has their real-time position as a .pb
Here is reprex
library(readr)
library(dplyr)
library(RProtoBuf)
readr::read_csv("https://storage.googleapis.com/storage/v1/b/mdb-csv/o/sources.csv?alt=media") |>
dplyr::filter(mdb_source_id == 1607) |>
dplyr::pull(urls.direct_download) |>
download.file(destfile = "data/hfx_transit_realtime_locations.pd")
RProtoBuf::read("GTFSv2.Realtime.Position", "data/hfx_transit_realtime_locations.pd")
Which produced the following error:
Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘read’ for signature ‘"character", "character"’
Following the example link from above I am not sure if this is the correct process as the provider I am looking to access lists out to a .pb, rather than a .proto.
URL = 'http://gtfs.halifax.ca/realtime/Vehicle/VehiclePositions.pb'`
Is there a different process or function calls to used for reading a .pb for GTFS? I made the assumption that using "GTFSv2.Realtime.Position"
was standard for all the feeds within GTFS.
My ultimate goal is to be able to access and plot real-time positions from
'http://gtfs.halifax.ca/realtime/Vehicle/VehiclePositions.pb'