UNPKG

gis-tools-ts

Version:

A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.

57 lines 1.96 kB
import { GTFSRealtimeEntity } from './entity.js'; import { GTFSRealtimeHeader } from './header.js'; export * from './stop/index.js'; export * from './trip/index.js'; export * from './alert.js'; export * from './entity.js'; export * from './header.js'; export * from './position.js'; export * from './shape.js'; export * from './util.js'; export * from './vehiclePosition.js'; /** * # GTFS Realtime message. * * ## Description * The input is a Uint8Array that has encoded protobuffer messages. * See {@link 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. * * ## Usage * * ```ts * import { GTFSRealtimeReader } from 'gis-tools-ts'; * * const gtfsRealtimeReader = new GTFSRealtimeReader(data); * const { header, entities } = gtfsRealtimeReader; * for (const entity of entities) { * console.log(entity); * } * ``` * * ## Links * - https://mobilitydatabase.org * - https://developers.google.com/transit/gtfs/examples/overview * - https://mobilitydata.github.io/ * - https://www.transit.land */ export declare class GTFSRealtimeReader { #private; header: GTFSRealtimeHeader; entities: GTFSRealtimeEntity[]; /** * @param data - the input data to parse * @param end - the size of the data, leave blank to parse the entire data */ constructor(data: ArrayBuffer | Uint8Array, end?: number); } //# sourceMappingURL=index.d.ts.map