plot_corridor: Plot Transit Corridors

View source: R/plot_.R

plot_corridorR Documentation

Plot Transit Corridors

Description

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.

Usage

plot_corridor(gtfs, i = 0.01, min.length = 1500)

Arguments

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'.

Details

The function performs the following steps:

  1. Extracts route shapes from the GTFS data using 'get_shapes_sf'.

  2. Identifies transit corridors using the 'get_corridor' function with the specified 'i' and 'min.length' parameters.

  3. Creates a map using 'ggplot2' with:

    1. Route shapes as the base layer (gray lines).

    2. High-density transit corridors as colored lines, with transparency for visualization.

Value

A 'ggplot' object representing the transit network with corridors overlaid. The plot includes:

Base map

Route shapes from the GTFS data, displayed in gray.

Corridors

High-density transit corridors, colored uniquely for each corridor.

Note

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.

See Also

[GTFSwizard::get_corridor()], [GTFSwizard::get_shapes_sf()]

Examples

plot_corridor(for_bus_gtfs, i = 0.02, min.length = 2000)



GTFSwizard documentation built on April 4, 2025, 4:10 a.m.