View source: R/get_distances.R
| get_distances | R Documentation |
Calculate distances in metres using the same segments for every summary.
get_distances(
gtfs,
method = "by_trip",
trips = "all",
distance_method = c("shapes", "straight")
)
gtfs |
A GTFS object. |
method |
One of '"by_trip"', '"by_route"', or '"detailed"'. |
trips |
Character trip IDs or '"all"'. |
distance_method |
Either '"shapes"' (default) or '"straight"'. |
Shape distances use stop and shape 'shape_dist_traveled' values together when available, converting their common units to metres using the shape geometry. Otherwise stops are projected onto shape segments in sequence order. This is an approximation, especially on loops; supplied distance measures are preferred. Missing shapes fall back to straight geodesic segments with a warning. Trip lengths cover only served segments, rather than the complete shared shape. Straight distances are geodesic.
A tibble. Detailed rows identify trips and their originating 'stop_sequence'; trip and route summaries retain service patterns.
get_distances(for_rail_gtfs, "by_trip")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.