Skip to content

Instantly share code, notes, and snippets.

@rafapereirabr
Created October 27, 2021 18:01
Show Gist options
  • Save rafapereirabr/2d8eb860721710e4f631c0f76f6c87ea to your computer and use it in GitHub Desktop.
Save rafapereirabr/2d8eb860721710e4f631c0f76f6c87ea to your computer and use it in GitHub Desktop.
test gtfs2gps
library(gtfs2gps)
library(gtfsrouter)
# original process
sp <- system.file("extdata/saopaulo.zip", package ="gtfs2gps")
time_gps <- system.time(gps_gps <- gtfs2gps(sp, parallel = T, spatial_resolution = 200))
# convert freq to stoptimes
sp_router <- extract_gtfs(filename = sp)
time_convertfreq <- system.time( gtfs_router <- gtfsrouter::frequencies_to_stop_times(sp_router) )
write_gtfs(gtfs_router, 'gtfs_router.zip')
time_router <- system.time(gps_router <- gtfs2gps('gtfs_router.zip', parallel = T, spatial_resolution = 200))
# compare computin time
time_gps
(time_router + time_gps)
> time_gps
user system elapsed
7.07 1.47 40.18
> (time_router + time_gps)
user system elapsed
10.78 2.97 86.29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment