Detta inlägg är gammalt och kan innehålla inaktuell information.

Service Alerts GTFS-RT issue

When trying to decode the ServiceAlerts.pb file, the following error happens
protobuf.tryToParse: Error: invalid wire type 7 at offset 17

Seems like something is bad in the binary for ServiceAlerts can you look into it

Kommentarer

  • Hey Justin!

    Does this happen for every serviceAlerts file or only for a specific operator? Can you download the file manually without errors?

    Regards,
    Bert
    Bert på Trafiklab
  • Hi Bert,

    The file can be downloaded automatically but it cannot be decoded in order to process the GTFS-RT. This happens when downloading from https://opendata.samtrafiken.se/gtfs-rt/sl/ServiceAlerts.pb and then attempting to decode it.
  • Hi Justin,

    I have tried with different programming languages (java, PHP), but have no problems opening that file. Is it possible that this is an issue with certain special characters (å,ö,ä) or compression?

    Regards,
    Bert
    Bert på Trafiklab
  • Hi Bert,

    We use this to decode the GTFS-RT protobuf
    https://github.com/MobilityData/gtfs-realtime-bindings/tree/master/nodejs

    maybe it has to do with the compression. We may have to uncompress first before attempting to decode?

    Do you know anything about this?

    Best,
    Justin
  • The HTTP response is compressed using gzip. This is a standard HTTP feature, indicated by the 'content-encoding: gzip' header, and most HTTP libraries should handle this in a transparent fashion, meaning you wouldn't have to do anything about this. However, if your HTTP library doesn't handle this, you'd manually have to decompress the response. You can read more about this HTTP header here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding

    Note that this is something which has been present op opendata.samtrafiken.se for the past months, so if your issue popped up just now and if it worked fine previously, then the problem probably lies somewhere else. I'll see if I can recreate the issue with the mobilitydata library.

    Regards,
    Bert



    Bert på Trafiklab

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.