shape_point_distances: Distance from each shape point to the previous one

View source: R/shapes_helpers.R

shape_point_distancesR Documentation

Distance from each shape point to the previous one

Description

Distance from each shape point to the previous one

Usage

shape_point_distances(shape_id, lat, lon)

Arguments

shape_id, lat, lon

The shape_id and coordinates of the shape points, sorted by shape and sequence, so that the points of each shape are contiguous.

Value

A numeric vector of distances in meters, on the same sphere used by {s2}. The first point of each shape is 0 meters away from its "previous" point, whatever its coordinates. For any other point, a missing coordinate in it or in the previous point gives NA.


gtfstools documentation built on Oct. 28, 2026, 5:13 p.m.