Vehicles historization

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)

Field name

BigQuery Type

Value

Example(s)

uuid

STRING

Universal Unique Identifier of the record

f7bd34b3-4693-4ca4-8b25-408046d1b9da

id

STRING

Universal Unique Identifier of the Vehicle

826bf443-232c-4dd0-98c7-0f1f72ccd348

timestamp

TIMESTAMP

Timestamp of the record

2023-07-18 09:41:06.966681 UTC

recorded_at_time

TIMESTAMP

Timestamp of the Vehicle update time

2023-07-18 09:41:06.966681 UTC

longitude

FLOAT

Longitude of the Vehicle

2.2558506530160867

latitude

FLOAT

Latitude of the Vehicle

48.721286921433595

bearing

FLOAT

Bearing of the Vehicle

36.0

codes

RECORD

List of identifiers of the Vehicle.

Each identifier is composed of a CodeSpace ( defined for an Ara partner by the remote_code_space) and a Value

[{"code_space":"internal","value":"MTA:Vehicle::9544592:LOC"}, ...]

occupancy

STRING

Occupancy of the Vehicle

manySeatsAvailable, full, seatsAvailable , ...

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;'