Created
February 14, 2023 11:56
-
-
Save vgXhc/029a1e61419963afb7661d661420b1cc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# code to get all stop locations from a GTFS feed and save them as a shapefile | |
library(tidytransit) | |
library(sf) | |
# find your agency's GTFS feed on https://openmobilitydata.org/feeds | |
gtfs <- read_gtfs("http://kamino.mcts.org/gtfs/google_transit.zip") | |
stops <- gtfs$stops | |
stops_sf <- st_as_sf(stops, coords = c("stop_lon", "stop_lat")) | |
# you can specify other output formats too | |
st_write(stops_sf, "stops.shp") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment