hsarkanen / JollaOpas

Jolla Opas
GNU General Public License v3.0
4 stars 4 forks source link

Use Digitransit MQTT broker for vehicle tracking #38

Open ZeiP opened 2 months ago

ZeiP commented 2 months ago

Currently SIRI APIs are used for vehicle tracking, but as I understand it the MQTT API would be more efficient and also provides much more cities: https://www.digitransit.fi/en/developers/apis/4-realtime-api/vehicle-positions/digitransit-mqtt/ . It'd be useful to provide MQTT tracking for the vehicles.

hsarkanen commented 2 days ago

Thanks for the suggestion, but implementing this would require a significant effort since Digitransit MQTT broker doesn't provide the same JSON payload [1] format what is used with HSL vehicle locations currently [2]. Instead Digitransit MQTT broker provides GTFS-RT protobuf payload which would need a parser in JollaOpas. Qt doesn't support protobuf out of the box until version 6.7 [3] and (SailfishOS uses currently Qt5.15.2) so probably some 3rd party parsing library would be needed.

On the other hand current implementations for vehicle tracking on HSL area, Tampere and Turku work and I assume that usage of public transportation and JollaOpas outside of those areas is very limited. So I think implementing this is currently not worth the effort.

[1] https://digitransit.fi/en/developers/apis/4-realtime-api/vehicle-positions/high-frequency-positioning/ [2] https://github.com/hsarkanen/JollaOpas/blob/c636b435f32587ce0f641490a7a766700c2d7454/qml/components/MapElement.qml#L51 [3] https://doc.qt.io/qt-6/whatsnew67.html