Learn R Programming

gtfstools (version 2.0.1)

resolve_shapes_method: Fall back to the euclidean method when a GTFS object has no usable shapes

Description

If method is "shapes" but the GTFS object has no shapes table or its trips table has no shape_id column (see has_shapes()), raises a warning of class gtfstools_shapes_unavailable and returns "euclidean". Otherwise returns method unchanged.

Usage

resolve_shapes_method(gtfs, method, fallback)

Value

A string, the method to use.

Arguments

gtfs

A GTFS object.

method

A string, "shapes" or "euclidean".

fallback

A string. The "i" bullet of the warning, which says what is calculated instead. It is interpolated by cli in the helper, so it may use cli markup but not the caller's variables.