Vehicles historization
Ara stores in BigQuery a vehicles table as soon as Ara receives an update information for a given vehicle.
Table schema
The following schema is used in the vehicles
Field name | BigQuery Type | Value | Example(s) |
|---|---|---|---|
uuid | STRING | Universal Unique Identifier of the record |
|
id | STRING | Universal Unique Identifier of the Vehicle |
|
timestamp | TIMESTAMP | Timestamp of the record |
|
recorded_at_time | TIMESTAMP | Timestamp of the Vehicle update time |
|
longitude | FLOAT | Longitude of the Vehicle |
|
latitude | FLOAT | Latitude of the Vehicle |
|
bearing | FLOAT | Bearing of the Vehicle |
|
codes | RECORD | List of identifiers of the Vehicle. Each identifier is composed of a CodeSpace ( defined for an Ara partner by the |
|
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.vehicles
The given key file can be used to request our vehicles historization table by using the BigQuery client: Use the bq tool | BigQuery | Google Cloud Documentation
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.vehicles order by timestamp desc limit 1;'