s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
113 lines • 3.86 kB
TypeScript
/**
* Indicates the direction of travel for a trip. This field should not be used in routing; it provides a way to separate trips by direction when publishing time tables. Valid options are:
* - 0 - Travel in one direction (e.g. outbound travel).
* - 1 - Travel in the opposite direction (e.g. inbound travel).
* Example: The trip_headsign and direction_id fields may be used together to assign a name to travel in each direction for a set of trips. A trips.txt file could contain these records for use in time tables:
* ```csv
* trip_id,...,trip_headsign,direction_id
* 1234,...,Airport,0
* 1505,...,Downtown,1
* ```
*/
export declare enum GTFSDirectionId {
/** Outbound, e.g., "Airport" */
Outbound = 0,// e.g., "Airport"
/** Inbound, e.g., "Downtown" */
Inbound = 1
}
/**
* Indicates wheelchair accessibility. Valid options are:
* - 0 or empty - No accessibility information for the trip.
* - 1 - Vehicle being used on this particular trip can accommodate at least one rider in a wheelchair.
* - 2 - No riders in wheelchairs can be accommodated on this trip.
*/
export declare enum GTFSWheelchairAccessibility {
/** Or empty */
NoInfo = 0,// or empty
/** At least one wheelchair */
Accessible = 1,// at least one wheelchair space
/** No wheelchair */
NotAccessible = 2
}
/**
* Indicates whether bikes are allowed. Valid options are:
* - 0 or empty - No bike information for the trip.
* - 1 - Vehicle being used on this particular trip can accommodate at least one bicycle.
* - 2 - No bicycles are allowed on this trip.
*/
export declare enum GTFSBikesAllowed {
/** Or empty */
NoInfo = 0,
/** at least one bicycle can be accommodated */
Allowed = 1,
/** no bicycles allowed */
NotAllowed = 2
}
/**
* # Trip Information
*
* ## Details
* **Required** - Trips for each route. A trip is a sequence of two or more stops that occur during
* a specific time period.
*/
export declare class GTFSTrip {
/**
* **Required**
* Identifies which route this trip belongs to (`routes.route_id`).
*/
routeId: string;
/**
* **Required**
* Identifies a set of dates when service is available (`calendar.service_id` or `calendar_dates.service_id`).
*/
serviceId: string;
/**
* **Required**
* Unique identifier for a trip (`trip_id`).
*/
id: string;
/**
* **Optional**
* Destination sign text that identifies the trip’s destination to riders.
*/
headsign?: string;
/**
* **Optional**
* Public-facing text used to identify the trip (e.g., train numbers).
*/
shortName?: string;
/**
* Updated to use an enum for direction.
* 0 = Outbound, 1 = Inbound.
*/
directionId?: GTFSDirectionId;
/**
* **Optional**
* Identifies the block this trip belongs to. Sequential trips with the same block_id typically use the same vehicle.
*/
blockId?: string;
/**
* **Conditionally Required**
* References a geospatial shape describing the vehicle's travel path (`shapes.shape_id`).
* Required if the trip uses continuous pickup or drop-off rules; otherwise optional.
*/
shapeId?: string;
/**
* Updated to use an enum for wheelchair accessibility.
* 0 = NoInfo, 1 = Accessible, 2 = NotAccessible.
*/
wheelchairAccessible?: GTFSWheelchairAccessibility;
/**
* Updated to use an enum for bikes allowed.
* 0 = NoInfo, 1 = Allowed, 2 = NotAllowed.
*/
bikesAllowed?: GTFSBikesAllowed;
/** @param data - the parsed GTFS CSV data */
constructor(data: Record<string, string>);
}
/**
* @param input - the input string to parse from
* @returns - an array of Trips
*/
export declare function parseGTFSTrips(input: string): GTFSTrip[];
//# sourceMappingURL=trips.d.ts.map