Skip to content

Tools to create GTFS from scratch or add to GTFS #88

@mattwigway

Description

@mattwigway

I have a number of students interested in using r5r to do analyses of transit system changes and a significant pain point is always when they want to create a GTFS feed. To my knowledge, there's not an R package that lets you do that easily (if I'm wrong, feel free to correct me), and I'm wondering if gtfstools would be a good place for it. It'd be lovely to be able to do something like this:

empty_gtfs("America/New_York") |>
  add_calendar("weekday", "20250101", "20261231", sat = F, sun = F) |>
  add_stops(sf_object) |>
  add_trip(
    route = "1", # route automatically created if it doesn't exist
    calendar = "weekday",
    tribble(
      ~stop_id , ~time      ,
             1 , "10:00:00" ,
             2 , "10:05:00" ,
             3 , "10:10:00"
    ),
    frequencies = tribble(
      ~from      , ~to        , ~headway_secs ,
      "06:00:00" , "08:00:00" ,           300 ,
      "08:00:00" , "16:00:00" ,           900 ,
      "16:00:00" , "20:00:00" ,           300
    )
  ) |>
  write_gtfs("new_route.zip")

Is this something that seems like a fit for gtfstools, or would it make more sense in a separate package?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions