The `plot_corridor` function visualizes high-density transit corridors on a map. It overlays the identified corridors on the route shapes from the GTFS data, providing a representation of the transit network and its key corridors.
plot_corridor(gtfs, i = 0.01, min.length = 1500)
A `ggplot` object representing the transit network with corridors overlaid. The plot includes:
Route shapes from the GTFS data, displayed in gray.
High-density transit corridors, colored uniquely for each corridor.
A GTFS object, preferably of class `wizardgtfs`. If not, the function will attempt to convert it using `GTFSwizard::as_wizardgtfs()`.
A numeric value representing the percentile threshold for selecting high-density segments. Defaults to `0.01` (top 1% of segments by trip frequency).
A numeric value specifying the minimum corridor length (in meters) to retain. Defaults to `1500`.
The function performs the following steps:
Extracts route shapes from the GTFS data using `get_shapes_sf`.
Identifies transit corridors using the `get_corridor` function with the specified `i` and `min.length` parameters.
Creates a map using `ggplot2` with:
Route shapes as the base layer (gray lines).
High-density transit corridors as colored lines, with transparency for visualization.
[GTFSwizard::get_corridor()], [GTFSwizard::get_shapes_sf()]
plot_corridor(for_bus_gtfs, i = 0.02, min.length = 2000)
Run the code above in your browser using DataLab