gis-tools-ts - v0.6.0
    Preparing search index...

    Class GTFSRealtimeReader

    GTFS Realtime message.

    The input is a Uint8Array that has encoded protobuffer messages. See https://open-s2.github.io/pbf/classes/PbfReader.html.

    The contents of a feed message. A feed is a continuous stream of feed messages. Each message in the stream is obtained as a response to an appropriate HTTP GET request. A realtime feed is always defined with relation to an existing GTFS feed. All the entity ids are resolved with respect to the GTFS feed. Note that "required" and "optional" as stated in this file refer to Protocol Buffer cardinality, not semantic cardinality. See reference.md at https://github.com/google/transit/tree/master/gtfs-realtime for field semantic cardinality.

    import { GTFSRealtimeReader } from 'gis-tools-ts';

    const gtfsRealtimeReader = new GTFSRealtimeReader(data);
    const { header, entities } = gtfsRealtimeReader;
    for (const entity of entities) {
    console.log(entity);
    }
    Index

    Constructors

    Constructors

    • Parameters

      • data: ArrayBuffer | Uint8Array<ArrayBufferLike>

        the input data to parse

      • end: number = 0

        the size of the data, leave blank to parse the entire data

      Returns GTFSRealtimeReader