get_stops_sf | R Documentation |
'get_stops_sf' converts the stops table in a 'wizardgtfs' object into a simple features ('sf') object, making it suitable for spatial analysis. This function checks the format of the 'stops' data and structures it as point geometries.
get_stops_sf(gtfs)
gtfs |
A 'wizardgtfs' object containing a 'stops' table or the stops table itself as a data frame. |
- When the input 'stops' table is not in 'sf' format, this function converts it to 'sf' by using the coordinates in the 'stop_lon' and 'stop_lat' columns.
- The resulting 'sf' object is assigned a CRS of WGS 84 (EPSG:4326) for geographic compatibility.
- If the 'stops' table is already in 'sf' format, the function simply reassigns the CRS and returns it unchanged.
An 'sf' object with stops as point geometries or a 'wizardgtfs' object.
[GTFSwizard::get_shapes()], [GTFSwizard::get_shapes_sf()], [GTFSwizard::get_shapes_df()]
# Convert stops data in a GTFS object to sf format
gtfs_sf <- get_stops_sf(for_rail_gtfs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.