Skip to content

Commit

Permalink
add fare filter by zone_id to filtering functions
Browse files Browse the repository at this point in the history
  • Loading branch information
dhersz committed Nov 28, 2023
1 parent 1ccd7bb commit 0ac3d1c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion R/filter_by_agency_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,15 @@ filter_by_agency_id <- function(gtfs, agency_id, keep = TRUE) {
gtfs <- filter_pathways_from_stop_id(gtfs, relevant_stops, `%chin%`)
gtfs <- filter_stops_from_stop_id(gtfs, relevant_stops, `%chin%`)

# 'stops' allows us to filter by 'level_id'
# 'stops' allows us to filter by 'level_id' and 'zone_id'

relevant_zones <- unique(gtfs$stops$zone_id)
relevant_levels <- unique(gtfs$stops$level_id)

# 'fare_rules' (zone_id)

gtfs <- filter_fare_rules_from_zone_id(gtfs, relevant_zones, `%chin%`)

# 'levels' (level_id)

gtfs <- filter_levels_from_level_id(gtfs, relevant_levels, `%chin%`)
Expand Down
7 changes: 6 additions & 1 deletion R/filter_by_service_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,15 @@ filter_by_service_id <- function(gtfs, service_id, keep = TRUE) {
gtfs <- filter_pathways_from_stop_id(gtfs, relevant_stops, `%chin%`)
gtfs <- filter_stops_from_stop_id(gtfs, relevant_stops, `%chin%`)

# 'stops' allows us to filter by 'level_id'
# 'stops' allows us to filter by 'level_id' and 'zone_id'

relevant_zones <- unique(gtfs$stops$zone_id)
relevant_levels <- unique(gtfs$stops$level_id)

# 'fare_rules' (zone_id)

gtfs <- filter_fare_rules_from_zone_id(gtfs, relevant_zones, `%chin%`)

# 'levels' (level_id)

gtfs <- filter_levels_from_level_id(gtfs, relevant_levels, `%chin%`)
Expand Down
7 changes: 6 additions & 1 deletion R/filter_by_shape_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,15 @@ filter_by_shape_id <- function(gtfs, shape_id, keep = TRUE) {
gtfs <- filter_pathways_from_stop_id(gtfs, relevant_stops, `%chin%`)
gtfs <- filter_stops_from_stop_id(gtfs, relevant_stops, `%chin%`)

# 'stops' allows us to filter by 'level_id'
# 'stops' allows us to filter by 'level_id' and 'zone_id'

relevant_zones <- unique(gtfs$stops$zone_id)
relevant_levels <- unique(gtfs$stops$level_id)

# 'fare_rules' (zone_id)

gtfs <- filter_fare_rules_from_zone_id(gtfs, relevant_zones, `%chin%`)

# 'levels' (level_id)

gtfs <- filter_levels_from_level_id(gtfs, relevant_levels, `%chin%`)
Expand Down
7 changes: 6 additions & 1 deletion R/filter_by_trip_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,15 @@ filter_by_trip_id <- function(gtfs, trip_id, keep = TRUE) {
gtfs <- filter_pathways_from_stop_id(gtfs, relevant_stops, `%chin%`)
gtfs <- filter_stops_from_stop_id(gtfs, relevant_stops, `%chin%`)

# 'stops' allows us to filter by 'level_id'
# 'stops' allows us to filter by 'level_id' and 'zone_id'

relevant_zones <- unique(gtfs$stops$zone_id)
relevant_levels <- unique(gtfs$stops$level_id)

# 'fare_rules' (zone_id)

gtfs <- filter_fare_rules_from_zone_id(gtfs, relevant_zones, `%chin%`)

# 'levels' (level_id)

gtfs <- filter_levels_from_level_id(gtfs, relevant_levels, `%chin%`)
Expand Down

0 comments on commit 0ac3d1c

Please sign in to comment.