However, what I really need to do is read the feed posted here
https://gtfsrt.api.translink.com.au/, which is v1.0 realtime. I have tried to just read it in with my existing code, but I get the following error:
====================
C:\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:1987
throw(e);
^
Error: Illegal value for Message.Field .transit_realtime.TripDescriptor.schedule_relationship: 5 (not a valid enum value)
at Field.ProtoBuf.Reflect.Field.verifyValue (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:2321:27)
at Message.set (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:1713:50)
at Message.ProtoBuf.Reflect.Message.decode (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:2139:29)
at Field.ProtoBuf.Reflect.Field.decode (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:2594:46)
at Message.ProtoBuf.Reflect.Message.decode (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:2139:51)
at Field.ProtoBuf.Reflect.Field.decode (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:2594:46)
at Message.ProtoBuf.Reflect.Message.decode (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:2139:51)
at Field.ProtoBuf.Reflect.Field.decode (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:2594:46)
at Message.ProtoBuf.Reflect.Message.decode (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:2137:51)
at Function.Message.decode (C:\stuff\_clients\david apelt\gtfs\gtfs_realtime\node_modules\protobufjs\ProtoBuf.js:1982:41)
====================
header {
gtfs_realtime_version: "2.0"
incrementality: FULL_DATASET
timestamp: 1549585866
}
header {
gtfs_realtime_version: "1.0"
timestamp: 1549426599
}
So "incrementality" is missing.
How do I modify my code to read in v1.0 realtime feed data? It is obviously breaking when it gets to the following line:
var feed = GtfsRealtimeBindings.FeedMessage.decode(body)
Thanks for any help.