| filter_area | R Documentation |
Select stops intersecting a polygon or bounding box, retaining either whole trips that serve those stops or only the calls inside the area.
filter_area(gtfs, area, full_trips = TRUE)
gtfs |
A GTFS object. |
area |
An 'sf'/'sfc' polygon with a known CRS, an 'st_bbox', or a numeric WGS84 bounding box ordered xmin, ymin, xmax, ymax. |
full_trips |
Logical. Retain complete trips (default). If 'FALSE', retain only inside calls; trips with fewer than two remaining calls are removed. Cropped endpoints must have known arrival and departure times. |
Selection uses stop points, including polygon boundaries, rather than shape intersection. Cropped trips keep original stop sequences and shapes; distance calculations cover only retained stops. Frequency windows are shifted when cropping changes the first stop. Original times and measures are retained. A crop may connect retained stops across an excluded area; it does not split trips into separate contiguous sections.
A 'wizardgtfs' object with related tables pruned. Parent stations are retained. No matching service returns an empty feed with a warning.
filter_area(for_rail_gtfs, c(-39, -4, -38, -3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.