High level wrapper that filters the supplied NeTEx fare files to the desired product(s), matches each line to a GTFS route, and adds the corresponding GTFS fare tables. Use `fares_version` to choose between the original GTFS fares specification and GTFS-Fares-v2.

gtfs_add_fares(
  gtfs,
  netex_list,
  fares_version = 1,
  trip_type = NULL,
  user_type = NULL,
  product_name = NULL,
  direction = NULL
)

Arguments

gtfs

a GTFS object (named list) as produced by [transxchange2gtfs()].

netex_list

list of parsed NeTEx fare objects, from [netex_read_fares_multiple()].

fares_version

numeric, `1` for the original GTFS fares (fare_attributes / fare_rules) or `2` for GTFS-Fares-v2. Default `1`.

trip_type, user_type, product_name, direction

optional filters passed to [netex_filter_fares()] to choose which fare product(s) to convert. For `fares_version = 1` you should select a single product type (e.g. `trip_type = "single", user_type = "adult"`); if several products remain they will all be emitted but GTFS v1 cannot distinguish passenger types.

Value

the GTFS object with fare tables added.