Active-Travel-Academy / ata-traffic-recorder

MIT License
3 stars 0 forks source link

Add TomTom data #2

Closed nikolai-b closed 3 years ago

nikolai-b commented 3 years ago

From @AnnaGoodman1:

Would you be able to have a quick look and see how much work it would be to adapt your current google API to be the same sql format and function, but instead use tomtom? and if not a huge task, do that work such that we have both options available?

nikolai-b commented 3 years ago

I think it makes sense to have a new tomtom_journey_runs table.

Tomtom give us:

lengthInMeters travelTimeInSeconds trafficDelayInSeconds
noTrafficTravelTimeInSeconds historicTrafficTravelTimeInSeconds liveTrafficIncidentsTravelTimeInSeconds

along with a polyline representation of the route. I would store all these but format them so they match the other columns, i.e.: traffic_delay_in_seconds. I'd also stick in a run_id so that it could be linked back to when the run started. Given the increase in requests per ltn I might also stick into the runs table finished_at in case it starts to get very long. Finally how should we deal with error handling with TomTom requests...

AnnaGoodman1 commented 3 years ago

this looks great to me Nikolai, happy to close this issue unless you have error handling points you want to keep open