noi-techpark / odh-mentor-otp

4 stars 8 forks source link

A.2.3 Connection with GTFS-R feed #15

Closed rcavaliere closed 3 years ago

rcavaliere commented 3 years ago

Thanks to the GTFS-R Feed we should be able to see real-time data as well

Prototype: https://journey.opendatahub.testingmachine.eu/en/#/

rcavaliere commented 3 years ago

@bertolla can you please integrate this PR? It's related to the configuration of the GTFS-Realtime Feed https://github.com/noi-techpark/odh-mentor-otp/pull/24

zabuTNT commented 3 years ago

Regarding this we introduced two env variable. GTFS_RT_URL is the URL to a protobuffer file with trip_updates entities. And, GTFS_FEED_ID, it's very important to understand what it is, because you will not find documentation about this. An OTP graph could be composed by many GTFS files. For each of these files OTP assigns an Id, the feed_id. Why? Because nothing prevents for example a route_id from appearing on multiple GTFS files. So, when you use GTFS-RT inside OTP you have to link to the relative GTFS file throgh this feed_id.

So how to know what feed_id is assigned to your GTFS file?

If you have only one GTFS it's easy, will be "1". (This is your case) But if you have multiple GTFS you cannot predict the feed_id, one time can be "1", next "2", and so on.

The only way to predict the feed_id is to insert in the GTFS zip the optional file feed_info.txt, with the unofficial key feed_id.

feed_publisher_name,feed_publisher_url,feed_lang,feed_start_date,feed_end_date,feed_version,feed_id
Trentino trasporti S.p.A.,http://www.trentinotrasporti.it/,it,20200914,20210625,20201211193808.013,TT_EXT

So, in this case, OTP will assign "TT_EXT" as feed_id, and I can use this feed_id when I set the GTFS-RT in OTP updaters.

In your case, with only one GTFS and without feed_info.txt with key feed_id, you can ignore all of this but I thought it might interest you.

bertolla commented 3 years ago

@rcavaliere I checked it, took it in and deployed on the server. @zabuTNT So this should also be part of our the documentation I guess?

zabuTNT commented 3 years ago

@bertolla I wrote a recap inside the README about this. https://github.com/noi-techpark/odh-mentor-otp/blob/development/README.md#building-arguments I don't know if you want write this extend explanation somewhere, because as I said probably you will use only a GTFS file.

rcavaliere commented 3 years ago

@zabuTNT that's very valuable information. I don't know if we are going to be the only GTFS data consumer... I don't think so in the long term period, we will see... :-) However it's good to have everything in the README, so that we can reuse it in the Open Data Hub documentation, in case we will do it.

rcavaliere commented 3 years ago

@bertolla @zabuTNT @stefanocudini I don't see real-time data anymore... any idea why?

zabuTNT commented 3 years ago

@rcavaliere Hi, it seems that GTFS-R are empty: https://efa.sta.bz.it/gtfs-r/?FORMAT=json

{
  "Header": {
    "GtfsRealtimeVersion": "1.0",
    "Incrementality": "FullDataset",
    "Timestamp": 1612513134
  },
  "Entity": []
}
rcavaliere commented 3 years ago

This issue should be solved now, the unavailability of the GTFS-R data was due to an upgrade of some Mentz components related to the production of the GTFS-R feed