UNPKG

s2-tools

Version:

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

72 lines 3.32 kB
import { GBFSReaderV1, GBFSV1 } from './schemaV1'; import { GBFSReaderV2, GBFSV2 } from './schemaV2'; import { GBFSReaderV3, GBFSV3 } from './schemaV3'; export * from './schemaV1'; export * from './schemaV2'; export * from './schemaV3'; /** * # General Bikeshare Feed Specification (GBFS) Reader * * ## Description * The versions of GBFS reader classes this data could be (1, 2, or 3) * Implements the {@link FeatureIterator} interface. * * ## Links * - https://github.com/MobilityData/gbfs * - https://github.com/MobilityData/gbfs-json-schema/tree/master/v3.0 */ export type GBFSReader = GBFSReaderV1 | GBFSReaderV2 | GBFSReaderV3; /** The versions of GBFS schemas this data could be */ export type GBFSTypess = GBFSV1 | GBFSV2 | GBFSV3; /** * Given a link to a GBFS feed, build the appropriate reader for the feed. * Examples: * - v3: https://backend.citiz.fr/public/provider/9/gbfs/v3.0/gbfs.json * - v2: https://gbfs.helbiz.com/v2.2/durham/gbfs.json * - v1: https://gbfs.urbansharing.com/gbfs/gbfs.json * @param url - The link to the GBFS feed * @param locale - The locale to use if provided, otherwise default to "en" (e.g., "en", "en-US"). * @returns - a GBFSReader of the appropriate version */ export declare function buildGBFSReader(url: string, locale?: string): Promise<GBFSReader>; /** System Definition that is returned from the github CSV file. */ export interface GBFSSystem { /** [**Required**] ISO 3166-1 alpha-2 code designating the country where the system is located. */ countryCode: string; /** [**Required**] Name of the mobility system. This MUST match the name field in system_information.json */ name: string; /** * [**Required**] Primary city in which the system is located, followed by the 2-letter state code * for US systems. The location name SHOULD be in English if the location has an English name * (eg: Brussels). */ location: string; /** [**Required**] ID for the system. This MUST match the system_id field in system_information.json. */ systemId: string; /** * [**Required**] URL for the system from the url field in system_information.json. * If the url field is not included in system_information.json this SHOULD be the primary URL * for the system operator. */ url: string; /** [**Required**] URL for the system's gbfs.json auto-discovery file. */ autoDiscoveryUrl: string; /** * [**Required**] List of GBFS version(s) under which the feed is published. Multiple values are * separated by a semi-colon surrounded with 1 space on each side for readability (" ; "). */ supportedVersions: string[]; /** * [**Conditionally Required**] If authentication is required, this MUST contain a URL to a * human-readable page describing how the authentication should be performed and how credentials * can be created, or directly contain the public key-value pair to append to the feed URLs. */ authInfo?: string; } /** * Fetches the systems from the github CSV file * @param url - The URL of the CSV file. The default is the one used by GBFS. This variable exists for testing * @returns - an array of systems */ export declare function fetchGTFSSystems(url?: string): Promise<GBFSSystem[]>; //# sourceMappingURL=index.d.ts.map