alignShapes: Calculate distance offsets for a set of overlapping shapes

Description Usage Arguments Value Examples

Description

Calculate distance offsets for a set of overlapping shapes

Usage

1
alignShapes(gtfs, from_stop, to_stop, crs, shape_ids = NULL)

Arguments

gtfs

path to zipped GTFS feed

from_stop

GTFS stop_id of stop that defines start of route segment.

to_stop

GTFS stop_id of stop that defines end of route segment

crs

local projection, default to UTM. Use a projection in meters.

shape_ids

character vector of shape_ids, one for each shape of interest in shapes.txt of GTFS. If NULL, will use all shapes within 30 m of from_stop and to_stop.

Value

data.table of shape_id, from_dist, to_dist and stop_order To use, add from_dist to avl_dist_traveled for each shape_id in a matched AVL dataset.

Examples

1
2
gtfs <- system.file('extdata', 'gtfs.zip', package = 'speedRT')
shape_offsets <- alignShapes(gtfs, from_stop = 13337, to_stop = 13320)

metrotransit/speedrt documentation built on June 13, 2019, 5:09 p.m.