s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
73 lines • 3.14 kB
JavaScript
import { GTFSRealtimeTranslatedString } from '..';
export * from './timeEvent';
export * from './update';
/** The type of wheelchair boarding accessibility at a stop. */
export var GTFSRealtimeWheelchairBoarding;
(function (GTFSRealtimeWheelchairBoarding) {
GTFSRealtimeWheelchairBoarding[GTFSRealtimeWheelchairBoarding["UNKNOWN"] = 0] = "UNKNOWN";
GTFSRealtimeWheelchairBoarding[GTFSRealtimeWheelchairBoarding["AVAILABLE"] = 1] = "AVAILABLE";
GTFSRealtimeWheelchairBoarding[GTFSRealtimeWheelchairBoarding["NOT_AVAILABLE"] = 2] = "NOT_AVAILABLE";
})(GTFSRealtimeWheelchairBoarding || (GTFSRealtimeWheelchairBoarding = {}));
/**
* Describes a stop which is served by trips. All fields are as described in the GTFS-Static specification.
* NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
*/
export class GTFSRealtimeStop {
stopId; // 1 [string]
stopCode; // 2 [message]
stopName; // 3 [message]
ttsStopName; // 4 [message]
stopDesc; // 5 [message]
stopLat; // 6 [float]
stopLon; // 7 [float]
zoneId; // 8 [string]
stopUrl; // 9 [string]
parentStation; // 11 [string]
stopTimezone; // 12 [string]
wheelchairBoarding = GTFSRealtimeWheelchairBoarding.UNKNOWN; // 13 [enum]
levelId; // 14 [string]
platformCode; // 15 [string]
/**
* @param pbf - The Protobuf object to read from
* @param end - The end position of the message in the buffer
*/
constructor(pbf, end) {
pbf.readFields(this.#readStop, this, end);
}
/**
* @param tag - The tag of the message
* @param stop - The stop to mutate
* @param pbf - The Protobuf object to read from
*/
#readStop(tag, stop, pbf) {
if (tag === 1)
stop.stopId = pbf.readString();
else if (tag === 2)
stop.stopCode = new GTFSRealtimeTranslatedString(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 3)
stop.stopName = new GTFSRealtimeTranslatedString(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 4)
stop.ttsStopName = new GTFSRealtimeTranslatedString(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 5)
stop.stopDesc = new GTFSRealtimeTranslatedString(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 6)
stop.stopLat = pbf.readFloat();
else if (tag === 7)
stop.stopLon = pbf.readFloat();
else if (tag === 8)
stop.zoneId = pbf.readString();
else if (tag === 9)
stop.stopUrl = new GTFSRealtimeTranslatedString(pbf, pbf.readVarint() + pbf.pos);
else if (tag === 11)
stop.parentStation = pbf.readString();
else if (tag === 12)
stop.stopTimezone = pbf.readString();
else if (tag === 13)
stop.wheelchairBoarding = pbf.readVarint();
else if (tag === 14)
stop.levelId = pbf.readString();
else if (tag === 15)
stop.platformCode = new GTFSRealtimeTranslatedString(pbf, pbf.readVarint() + pbf.pos);
}
}
//# sourceMappingURL=index.js.map