The function performs the following steps:
- Validates that the `shape` object is of class `sf` and contains a `shape_id` column.
- Extracts point coordinates from each shape’s geometry, creating a sequence of latitude and longitude points.
- Computes cumulative distances along the shape, using Euclidean distance between consecutive points.
The resulting data frame conforms to the GTFS `shapes.txt` format. Distances are expressed in meters.