The VKT of a route is the sum, over its trips, of the length of each trip
times its number of departures times the number of counted days on which
its service runs, according to the calendar and calendar_dates tables.
Departures are counted as in get_route_frequency(): trips listed in the
frequencies table depart once per headway, the other trips depart once,
and departures after midnight belong to the previous service day (times
after midnight written as early morning times are fixed first, as in
get_route_frequency()). Unlike in
get_route_frequency(), the time of day includes to, as in
get_trip_length(). An error is raised if the frequencies table has
invalid entries for trips that run on the counted days.
Trip lengths are calculated with get_trip_length(), along the shape of
each trip from its first to its last stop, so trips to and from the depot
are not included. If the GTFS has no shapes table, the straight-line
distances between stops are used instead, with a warning. Trips whose
length is unknown (e.g. trips without a usable shape, which also raise a
warning, or trips listed in frequencies but not in stop_times) add
nothing to the VKT, but the days on which they run still count in
n_days. If no counted trip of a route has a known length, its vkt is
NA.