This function is deprecated and will be removed in a future
version. Use gtfstools::get_stops_geometry() instead.
Convert the stops of a GTFS data loaded using
read_gtfs into a POINT simple feature (sf) object, using
get_stops_geometry. The input data is not modified.
Arguments
- gtfs
A GTFS data.
stop_idmust be character andstop_lonandstop_latnumeric, as produced byread_gtfs.- crs
The coordinate reference system of the output: an EPSG code, a string accepted by
st_crs, or acrsobject. Stops are read as WGS84 (EPSG:4326) and transformed tocrs. The default value is 4326 (no transformation). Other inputs (e.g.NA) raise an error, and an empty or unknown CRS raises an error of classgtfs2gps_crs_error.
Examples
poa <- read_gtfs(system.file("extdata/poa.zip", package = "gtfs2gps"))
#> Unzipped the following files to /tmp/RtmpL1LF2I/gtfsio:
#> * agency.txt
#> * calendar.txt
#> * routes.txt
#> * shapes.txt
#> * stop_times.txt
#> * stops.txt
#> * trips.txt
#> Reading agency
#> Reading calendar
#> Reading routes
#> Reading shapes
#> Reading stop_times
#> Reading stops
#> Reading trips
poa_stops <- suppressWarnings(gtfs_stops_as_sf(poa))
