UNPKG

s2-tools

Version:

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

109 lines 3.63 kB
/** * * Duration limit type for how transfer durations are measured. * Required if `duration_limit` is defined, forbidden otherwise. * * 0 - Between departure of current leg & arrival of next leg * 1 - Between departure of current leg & departure of next leg * 2 - Between arrival of current leg & departure of next leg * 3 - Between arrival of current leg & arrival of next leg */ export declare enum GTFSDurationLimitType { /** Between departure of current leg & arrival of next leg */ DepCurrentArrNext = 0, /** Between departure of current leg & departure of next leg */ DepCurrentDepNext = 1, /** Between arrival of current leg & departure of next leg */ ArrCurrentDepNext = 2, /** Between arrival of current leg & arrival of next leg */ ArrCurrentArrNext = 3 } /** * * Fare transfer type describing how costs are processed between consecutive legs: * * 0 = (A) + (AB) * 1 = (A) + (AB) + (B) * 2 = (AB) */ export declare enum GTFSFareTransferType { /** A + AB */ FromLegPlusTransfer = 0,// A + AB /** A + AB + B */ FromLegTransferToLeg = 1,// A + AB + B /** AB */ TransferOnly = 2 } /** * # Fare Transfer Rules * * **Optional** * Defines the cost of transferring between fare legs specified in `fare_leg_rules.txt`. * Matching uses: * - from_leg_group_id * - to_leg_group_id * - transfer_count * - duration_limit * - duration_limit_type * - fare_transfer_type * - fare_product_id * * **Primary Key**: (from_leg_group_id, to_leg_group_id, fare_product_id, transfer_count, duration_limit) */ export declare class GTFSFareTransferRule { /** * **Optional** * The pre-transfer fare leg group (`fare_leg_rules.leg_group_id`). * - If no exact match is found, empty corresponds to all leg groups not listed under `from_leg_group_id`. */ fromLegGroupId?: string; /** * **Optional** * The post-transfer fare leg group (`fare_leg_rules.leg_group_id`). * - If no exact match is found, empty corresponds to all leg groups not listed under `to_leg_group_id`. */ toLegGroupId?: string; /** * **Conditionally Forbidden / Required** * Defines how many consecutive transfers this rule may be applied to. * - `-1` means no limit. * - `1` or more = the transfer count this rule applies to. * * Forbidden if `from_leg_group_id !== to_leg_group_id`. * Required if `from_leg_group_id === to_leg_group_id`. */ transferCount?: number; /** * **Optional** * Duration limit (in seconds) for the transfer. Empty means no limit. */ durationLimit?: number; /** * **Conditionally Required** * Defines how to measure the `durationLimit`. * - Required if `durationLimit` is defined. * - Forbidden if `durationLimit` is empty. */ durationLimitType?: GTFSDurationLimitType; /** * **Required** * Indicates how to combine transfer costs: * - 0 = from-leg cost + transfer cost * - 1 = from-leg + transfer + to-leg cost * - 2 = transfer cost only */ fareTransferType: GTFSFareTransferType; /** * **Optional** * Fare product ID for the transfer. If empty, cost is 0 (no transfer cost). */ fareProductId?: string; /** @param data - the parsed GTFS CSV data */ constructor(data: Record<string, string>); } /** * @param input - the input string to parse from * @returns - an array of GTFSFareTransferRules */ export declare function parseGTFSFareTransferRules(input: string): GTFSFareTransferRule[]; //# sourceMappingURL=fareTransferRules.d.ts.map