Long term stop visits historization
Ara stores in BigQuery long_term_stop_visits
table “terminated” Stop Visits:
when departure status is
departed
when arrival and departure statuses are
cancelled
Table schema
The following schema is used in the long_term_stop_visits
Field name | BigQuery Type | Value | Example(s) |
---|---|---|---|
uuid | STRING | Universal Unique Identifier of the record |
|
timestamp | TIMESTAMP | Timestamp of the record |
|
stop_visit_uuid | STRING | Universal Unique Identifier of the Stop Visit |
|
aimed_departure_time | TIMESTAMP | Theoretical departure time |
|
aimed_arrival_time | TIMESTAMP | Theoretical arrival time |
|
expected_departure_time | TIMESTAMP | Expected departure time |
|
expected_arrival_time | TIMESTAMP | Expected arrival time |
|
actual_departure_time | TIMESTAMP | Real arrival time |
|
actual_arrival_time | TIMESTAMP | Real departure time |
|
departure_status | TIMESTAMP | Departure status |
|
arrival_status | STRING | Arrival Status |
|
stop_area_name | STRING | Name of the stop area |
|
stop_area_codes | RECORD | List of identifiers of a stop area. Each identifier is composed of a kind ( defined for an Ara partner by the |
|
stop_area_coordinates | GEOGRAPHY | Geographical coordinates of the stop area |
|
line_name | STRING | Name of the line |
|
line_number | STRING | Number of the line |
|
transport_mode | STRING | Type of transport mode |
|
line_codes | RECORD | List of identifiers of a line. Each identifier is composed of a kind ( defined for an Ara partner by the |
|
vehicle_journey_direction_type | STRING | Direction of the vehicle journey |
|
vehicle_journey_origin_name | STRING | stop area origin name of the vehicle journey |
|
vehicle_journey_destination_name | STRING | stop area destination name of the vehicle journey |
|
vehicle_journey_codes | RECORD | List of identifiers of a vehicle journey Each identifier is composed of a kind ( defined for an Ara partner by the |
|
vehicle_driver_ref | STRING | Driver reference of the vehicle |
|
vehicle_occupancy | STRING | Occupancy of the vehicle |
|
Accessing the data
Prerequisite: ask to the enRoute support team a JSON credential file.
For a Ara referential named my_referential
, the BigQuery table is named enroute-production.ara_my_referential.long_term_stop_visits
The given key file can be used to request our long term stop visits historization table by using the BigQuery client: Load and query data with the bq tool | BigQuery | Google Cloud
For example, in a docker
environment:
docker run -it -v $PWD:/data google/cloud-sdk:latest
$ gcloud auth activate-service-account --key-file /data/key.json
$ gcloud config set project enroute-production
$ bq query --use_legacy_sql=false --format json 'select * from enroute-production.ara_my_referential.long_term_stop_visits order by timestamp desc limit 1;'