convert_stops_to_sf: Convert 'stops' table to simple feature object

Description Usage Arguments Value Examples

View source: R/convert_stops_to_sf.R

Description

Converts the stops table to a POINT sf object.

Usage

1
convert_stops_to_sf(gtfs, stop_id = NULL, crs = 4326)

Arguments

gtfs

A GTFS object.

stop_id

A character vector including the stop_ids to be converted. If NULL (the default), all stops are converted.

crs

The CRS of the resulting object, either as an EPSG code or as an crs object. Defaults to 4326 (WGS 84).

Value

A POINT sf object.

Examples

1
2
3
4
5
6
7
8
9
# read gtfs
data_path <- system.file("extdata/spo_gtfs.zip", package = "gtfstools")
gtfs <- read_gtfs(data_path)

stops_sf <- convert_stops_to_sf(gtfs)
head(stops_sf)

stops_sf <- convert_stops_to_sf(gtfs, stop_id = "18848")
stops_sf

gtfstools documentation built on Nov. 16, 2021, 9:20 a.m.