get_shapes_df: Convert Shape Geometries to a GTFS Shapes Table

View source: R/get_shapes_df.R

get_shapes_dfR Documentation

Convert Shape Geometries to a GTFS Shapes Table

Description

Convert Shape Geometries to a GTFS Shapes Table

Usage

get_shapes_df(shape)

Arguments

shape

An 'sf' object with a 'shape_id' field and line geometries.

Details

Distances are geodesic approximations between consecutive coordinates. GTFS permits any consistent distance unit; this function uses meters.

Value

A tibble containing 'shape_id', WGS84 point coordinates, 'shape_pt_sequence', and cumulative 'shape_dist_traveled' in meters.

References

[GTFS Schedule Reference](https://gtfs.org/documentation/schedule/reference/#shapestxt)

See Also

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

Examples

shapes_sf <- get_shapes_sf(for_rail_gtfs)$shapes
shapes_df <- get_shapes_df(shapes_sf)


GTFSwizard documentation built on Aug. 21, 2026, 5:16 p.m.