plot_corridor | R Documentation |
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)
gtfs |
A GTFS object, preferably of class 'wizardgtfs'. If not, the function will attempt to convert it using 'GTFSwizard::as_wizardgtfs()'. |
i |
A numeric value representing the percentile threshold for selecting high-density segments. Defaults to '0.01' (top 1% of segments by trip frequency). |
min.length |
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.
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.
Ensure the 'gtfs' object includes valid 'shapes' and 'stop_times' tables for accurate visualization. The corridors are identified using the 'get_corridor' function, which relies on stop and trip data.
[GTFSwizard::get_corridor()], [GTFSwizard::get_shapes_sf()]
plot_corridor(for_bus_gtfs, i = 0.02, min.length = 2000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.