s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
47 lines • 1.47 kB
TypeScript
/**
* # Fare Rules
*
* **Optional**
* Defines how fares in `fare_attributes.txt` apply to an itinerary.
* For more complex fare structures, multiple combinations of fields
* (route, origin, destination, zones) can be used.
*/
export declare class GTFSFareRule {
/**
* **Required**
* Identifies a fare class (`fare_attributes.fare_id`).
*/
fareId: string;
/**
* **Optional**
* Route associated with this fare. If multiple routes share the same fare,
* add multiple records in `fare_rules.txt`.
*/
routeId?: string;
/**
* **Optional**
* Origin zone (`stops.zone_id`). If a fare class applies to multiple origin zones,
* each zone requires its own record.
*/
originId?: string;
/**
* **Optional**
* Destination zone (`stops.zone_id`). If a fare class applies to multiple destination zones,
* each zone requires its own record.
*/
destinationId?: string;
/**
* **Optional**
* All zones traveled during the trip using this fare class.
* If multiple zones must be passed, each is listed separately.
*/
containsId?: 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 GTFSFareRules
*/
export declare function parseGTFSFareRules(input: string): GTFSFareRule[];
//# sourceMappingURL=fareRules.d.ts.map