context('Converting GTFS routes and shapes into simple feature (sf) dataframes')
library(sf)
# convert_gtfs_routes_to_sf()
test_that('Can convert a gtfsr routes dataframe to a simple features dataframe', {
expect_is(routes_df_as_sf(gtfs_obj), 'sf')
})
test_that('Can convert a gtfsr stops dataframe to a simple features dataframe', {
expect_is(stops_df_as_sf(gtfs_obj$stops_df), 'sf')
})
test_that('Can filter on route id', {
routes <- c(1681,1683)
tworoutes <- gtsf::routes_df_as_sf(gtfs_obj,route_ids=routes)
expect_equal(dim(tworoutes)[1],2)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.