Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Store timestamp of each VehiclePosition entity #12

Open
answerquest opened this issue Jun 23, 2019 · 1 comment
Open

Store timestamp of each VehiclePosition entity #12

answerquest opened this issue Jun 23, 2019 · 1 comment

Comments

@answerquest
Copy link

Ref: https://github.com/google/transit/blob/master/gtfs-realtime/spec/en/reference.md#message-vehicleposition

There is a 'timestamp' field in each entity in a VehiclePositions feed in addition to the feed's timestamp. It records the moment at which the vehicle's position was measured.

This value is important - because it's possible for the feed to be carrying older positions. In analysis of archives, measuring the latency (time difference between feed time and vehicle time) can be important. It would be great if gtfsrdb can make a column and store this value as well in the vehicle_positions table.

Present creation statement in the sqlite db:

CREATE TABLE vehicle_positions ( oid INTEGER NOT NULL, trip_id VARCHAR(64), route_id VARCHAR(64), trip_start_time VARCHAR(8), trip_start_date VARCHAR(10), vehicle_id VARCHAR(10), vehicle_label VARCHAR(255), vehicle_license_plate VARCHAR(10), position_latitude FLOAT, position_longitude FLOAT, position_bearing FLOAT, position_speed FLOAT, occupancy_status VARCHAR(27), timestamp DATETIME, PRIMARY KEY (oid) )
@barbeau
Copy link
Member

barbeau commented Jun 24, 2019

+1 for this feature - it's really important when trying to generate predictions from vehicle positions as well.

We're not currently actively working on this project but PRs accepted!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants