| get_shape_geometry | R Documentation |
This function returns an SF multilinestring of the route alignments from
GTFS shapes. Similar to tidytransit::get_geometry(), but allows filtering
by shape_id and projection to a new coordinate system. See Details for
requirements on the input GTFS.
get_shape_geometry(gtfs, shape = NULL, project_crs = 4326)
gtfs |
A |
shape |
Optional. A vector of GTFS |
project_crs |
Optional. A numeric EPSG identifer indicating the coordinate system to use for spatial calculations. Consider setting to a Euclidian projection, such as the appropriate UTM zone. Default is 4326 (WGS 84 ellipsoid). |
A shapes file must be present in your GTFS object. This file must contain
at least the following fields:
shape_id
shape_pt_lat
shape_pt_lon
shape_pt_sequence
An SF multilinestring, with one multilinestring object per
shape_id.
# Set my parameters
my_shape <- "804EB_RC_221121"
my_crs = 32611
# Get shape from WMATA GTFS
lineE_shape <- get_shape_geometry(gtfs = lacmta_gtfs,
shape = my_shape,
project_crs = my_crs)
print(lineE_shape)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.