s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
72 lines • 3.33 kB
TypeScript
import { GTFSRealtimeAlert, GTFSRealtimeShape, GTFSRealtimeStop, GTFSRealtimeTripDescriptor, GTFSRealtimeTripModifications, GTFSRealtimeTripUpdate, GTFSRealtimeVehiclePosition } from '.';
import type { Pbf as Protobuf } from '../..';
/** The type of the message. */
export type GTFSRealtimeMessageType = 'deleted' | 'tripUpdate' | 'vehiclePosition' | 'alert' | 'shape' | 'stop' | 'tripModifications';
/**
* A definition (or update) of an entity in the transit feed.
* May be a TripUpdate, VehiclePosition, Alert, Shape, Stop, and/or TripModifications.
* At least one of the above must be present (unless the entity is being deleted).
*/
export declare class GTFSRealtimeEntity {
#private;
/**
* The ids are used only to provide incrementality support. The id should be
* unique within a FeedMessage. Consequent FeedMessages may contain
* FeedEntities with the same id. In case of a DIFFERENTIAL update the new
* FeedEntity with some id will replace the old FeedEntity with the same id
* (or delete it - see is_deleted below).
* The actual GTFS entities (e.g. stations, routes, trips) referenced by the
* feed must be specified by explicit selectors (see EntitySelector below for
* more info).
*/
id: string;
/** Whether this entity is to be deleted. Relevant only for incremental fetches */
isDeleted: boolean;
tripUpdate?: GTFSRealtimeTripUpdate;
/** Realtime positioning information for a given vehicle. */
vehiclePosition?: GTFSRealtimeVehiclePosition;
alert?: GTFSRealtimeAlert;
/**
* Describes the physical path that a vehicle takes when it's not part of the (CSV) GTFS,
* such as for a detour. Shapes belong to Trips, and consist of a sequence of shape points.
* Tracing the points in order provides the path of the vehicle. Shapes do not need to intercept
* the location of Stops exactly, but all Stops on a trip should lie within a small distance of
* the shape for that trip, i.e. close to straight line segments connecting the shape points
* NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
*/
shape?: GTFSRealtimeShape;
stop?: GTFSRealtimeStop;
tripModifications?: GTFSRealtimeTripModifications;
/**
* @param pbf - The Protobuf object to read from
* @param end - The end position of the message in the buffer
*/
constructor(pbf: Protobuf, end: number);
/**
* The type of the message
* @returns The type of the message
*/
get messageType(): GTFSRealtimeMessageType;
}
/**
* A selector for an entity in a GTFS feed.
* The values of the fields should correspond to the appropriate fields in the
* GTFS feed.
* At least one specifier must be given. If several are given, then the
* matching has to apply to all the given specifiers.
*/
export declare class GTFSRealtimeEntitySelector {
#private;
agencyId?: string;
routeId?: string;
routeType?: number;
trip?: GTFSRealtimeTripDescriptor;
stopId?: string;
directionId?: number;
/**
* @param pbf - The Protobuf object to read from
* @param end - The end position of the message in the buffer
*/
constructor(pbf: Protobuf, end: number);
}
//# sourceMappingURL=entity.d.ts.map