Output files

Besides the files per block, the output step can write counts and a median per pair, and three items merge the files per block into larger files. Where the output of a component goes and what is in it, is on How to run the model.

Counts next to the output

The output step also writes the counts of each block, Tellingen/tellingen_<n>of<N>.csv in the output folder, in the same request as the files per block (PublicTransport/Generate_Output/Traveltime_ForEachDepTime/Counts). They come from the final result of each departure moment, which is in memory anyway for the file per block, behind the fence of that moment (PerDepartureMoment_T, CreateExports/LongFormat/Results_Traveltime/Counts). After the last portion, batch\WriteOutputBlocks.ps1 runs batch\OdTellingen.py, which adds up the blocks, each with its own origins, into two tables in the output folder:

File Rows Columns
od_tellingen.csv the rows of the output per kind of option (Classifications/OD_Counts_Kind): alle, OV-keten (a chain with pre- and post-transport), and the direct trips WW, CC and AA soort, one column per departure moment (07h00m …), totaal
unieke_od_tellingen.csv the unique origin-destination pairs with at least one option of that kind, or for that group of travellers (Classifications/OD_Counts_Group): alle, OV-keten, WW, CC, AA, zonder auto (NeedsCar 0) and zonder auto en fiets (NeedsCar and NeedsBike 0) groep, one column per departure moment, samen (the union over the departure moments)

In one request for all blocks (NetworkSetup/GenerateOutput/Generate_Output, or UpdateAll.cmd output with the environment variable OUTPUT_SINGLE), NetworkSetup/ConfigurationPerBlock/Generate_Output/OD_Counts writes the two tables itself.

python batch\OdTellingen.py <output folder> [--force] can also be run on its own. It adds up the files in Tellingen, or, when there are none, counts the per-block csv files itself. It stops when blocks or moments are missing or when the two tables already exist (--force overwrites). The GeoDMS Academy compares a Python and a GeoDMS implementation of these counts, with measured run times.

Median travel time per pair

With Advanced/MakeMedian the output step also writes the median per origin-destination pair over the departure moments, one file per block, Mediaan/tt_<Analysis_date>_mediaan_<n>of<N>.csv (.parquet with OutputFormat 'parquet'), in the same request as the files per block (Generate_Output/Traveltime_ForEachDepTime/Median). It is FALSE by default, because the medians are not part of the delivery.

Per departure moment it takes the cheapest option of each pair: the lowest Price, at equal price the lowest Traveltime. Over the departure moments with an option it writes:

  • Traveltime_median, the median travel time (rth_element; for an even number the mean of the two middle values), and Traveltime_min and Traveltime_max, the fastest and the slowest;
  • TravelDist_median, the median distance (TravelDist_V + TravelDist_PT + TravelDist_N, in m);
  • Price_median, the median price in euro;
  • NrMoments, the number of departure moments with an option; 1 for a component with one departure moment.

It takes all options of the component. For Car that is the direct car trip, whose travel time includes the start and parking time (Car_StartTime + Car_ParkingTime, 5 min) on top of the limit MaxCarTime (90 min) on the driving time.

Merging the output files

Three items combine the files per block of a run into larger files, each building on the one before. They read the csv files per block, with the departure moment in the column names, so they need a run with OutputFormat 'csv'.

Per departure moment

NetworkSetup/ConfigurationPerBlock/Merge_Output/MergeRegions/OUTPUT_Merge_PublicTransport_Regions_fullOD_long_CSVFiles reads the per-block files of each departure moment and writes one file per departure moment, <output folder>/tt_<Analysis_date>_<moment>.csv. Its columns are OrgName, DestName, Traveltime, ModeUsed, NeedsCar, NeedsBike and Price, and distance, time and price per category:

  • per leg TravelDist_V, TravelDist_PT, TravelDist_N, WaitingTime, PretransTime, PTTime, PosttransTime, PretransPrice, PTPrice and PosttransPrice;
  • per mode TravelDist_Walking, TravelDist_Cycling, WalkingTime, CyclingTime, CarTime, WalkingPrice, CyclingPrice and CarPrice.

A column is empty when the per-block file does not have it; see step 7 of Public transport.

Over the departure moments

NetworkSetup/ConfigurationPerBlock/Merge_Output/MergeTimes/OUTPUT_Merge_PublicTransport_Times_fullOD_long_CSVFiles reads the files per departure moment and writes <output folder>/tt_<Analysis_date>.csv: all departure moments below each other, with a column for the moment and the same columns as the files per departure moment.

The median over the departure moments

Output/PostAnalysis/FindMedian/Result/MedianTT reads the file over all departure moments. It writes per origin and destination the fastest front row of each departure moment, and the median of those over the departure moments with a connection (NrMoments), for the pairs with a median up to FindMedian/SearchLimit (30 minutes). Rows whose ModeUsed is in FindMedian/ExcludedModes (default AA, the direct car trip) do not count, so that the median describes accessibility without a car.

Folder, checks and size

<output folder> is %LocalDataProjDir%/Output/<Analysis_date>_<OutputLabel>_<component>. The readers check its signature first and stop when it is missing or differs from the current parameters (NetworkSetup/GenerateOutput/Output_Sig/CheckGate). They build the file names as the writer per block does, use its column names, read Price only when the file has that column, and read and write through GDAL. The merged files are comma-delimited with quoted text.

As an example of the size: one departure moment of 1 October 2024 over 450 origin blocks is 39 million rows. The merge per moment took about 35 minutes and 15 GB, the merge over the moments about 30 minutes for that one moment, and FindMedian 7 minutes.