Getting VKT & number of bus operating for each route #104
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi @nadiaqamilla
library(gtfs2emis)
library(gtfstools)
# read GTFS
gtfs_file <- system.file("extdata/bra_cur_gtfs.zip", package = "gtfs2emis")
gtfs <- gtfstools::read_gtfs(gtfs_file)
# keep a single trip_id to speed up this example
gtfs_small <- gtfstools::filter_by_trip_id(gtfs, trip_id ="4451136")
# run transport model
tp_model <- gtfs2emis::transport_model(gtfs_data = gtfs_small,
min_speed = 2,
max_speed = 80,
new_speed = 20,
spatial_resolution = 100,
parallel = FALSE)
# 1) total VKT from 'transport_model' function
sum(tp_model$dist)
# 2) total VKT using gtfstools
gtfstools::get_trip_length(gtfs_small,trip_id = "4451136")
|
Beta Was this translation helpful? Give feedback.
-
Note that |
Beta Was this translation helpful? Give feedback.
Hi @nadiaqamilla
The codes we used to reproduce the results from the article can be found in this repository <https://github.com/ipeaGIT/gtfs2emis_paper>.
Two quick comments:
Regarding the number of buses in each operating line, in the article we assigned a distribution of buses with the same characteristics as the fleet data of São Paulo. The ideal scenario would be to have a single bus type for each trip_id. However, given the lack of detailed data (e.g. bus ID X assigned to route Y), we assumed that all of São Paulo's buses have equal chances of accessing a certain route. You can access the fleet data in this script <https://github.com/ipeaGIT/gtfs2emis_paper/blob/main/R/1.0_data-pre…