gis-tools-ts
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
159 lines • 6.81 kB
TypeScript
import { BufferJSONReader } from '../../../index.js';
import { type GTFSAgency } from './agency.js';
import { type GTFSArea } from './areas.js';
import { type GTFSAttribution } from './attributions.js';
import { type GTFSBookingRule } from './bookingRules.js';
import { type GTFSCalendar } from './calendar.js';
import { type GTFSCalendarDate } from './calendarDates.js';
import { type GTFSFareAttribute } from './fareAttributes.js';
import { type GTFSFareLegJoinRule } from './fareLegJoinRules.js';
import { type GTFSFareLegRule } from './fareLegRules.js';
import { type GTFSFareMedia } from './fareMedia.js';
import { type GTFSFareProduct } from './fareProducts.js';
import { type GTFSFareRule } from './fareRules.js';
import { type GTFSFareTransferRule } from './fareTransferRules.js';
import { type GTFSFeedInfo } from './feedInfo.js';
import { type GTFSFrequency } from './frequencies.js';
import { type GTFSLevel } from './levels.js';
import { type GTFSLocationGroup } from './locationGroups.js';
import { type GTFSLocationGroupStop } from './locationGroupStops.js';
import { type GTFSNetwork } from './networks.js';
import { type GTFSPathway } from './pathways.js';
import { type GTFSRoute } from './routes.js';
import { type GTFSRouteNetwork } from './routeNetworks.js';
import { type GTFSShapeProperties } from './shapes.js';
import { type GTFSStop, type GTFSStopProperties } from './stops.js';
import { type GTFSStopArea } from './stopAreas.js';
import { type GTFSStopTime } from './stopTimes.js';
import { type GTFSTimeframe } from './timeframes.js';
import { type GTFSTransfer } from './transfers.js';
import { type GTFSTranslation } from './translations.js';
import { type GTFSTrip } from './trips.js';
import type { FeatureIterator } from '../../index.js';
import type { MValue, Properties, VectorFeature, VectorLineStringGeometry, VectorMultiPolygonGeometry, VectorPointGeometry, VectorPolygonGeometry } from '../../../geometry/index.js';
export * from './agency.js';
export * from './areas.js';
export * from './attributions.js';
export * from './bookingRules.js';
export * from './calendar.js';
export * from './calendarDates.js';
export * from './fareAttributes.js';
export * from './fareLegJoinRules.js';
export * from './fareLegRules.js';
export * from './fareMedia.js';
export * from './fareProducts.js';
export * from './fareRules.js';
export * from './fareTransferRules.js';
export * from './feedInfo.js';
export * from './frequencies.js';
export * from './levels.js';
export * from './locationGroups.js';
export * from './locationGroupStops.js';
export * from './networks.js';
export * from './pathways.js';
export * from './routeNetworks.js';
export * from './routes.js';
export * from './shapes.js';
export * from './stopAreas.js';
export * from './stops.js';
export * from './stopTimes.js';
export * from './timeframes.js';
export * from './transfers.js';
export * from './translations.js';
export * from './trips.js';
/** A piece of the GTFS schedule */
export interface Piece {
filename: string;
data: string;
}
/**
* `locations.geojson` data properties
* Defines zones where riders can request either pickup or drop off by on-demand services.
* These zones are represented as GeoJSON polygons.
*/
export interface GTFSLocationsProperties extends Properties {
stop_name: string;
stop_desc: string;
}
/** A Shape Feature */
export type GTFSShapeFeature = VectorFeature<Record<string, unknown>, MValue, GTFSShapeProperties, VectorLineStringGeometry>;
/** A Poly Feature */
export type GTFSPolyFeature = VectorFeature<Record<string, unknown>, MValue, GTFSLocationsProperties, VectorMultiPolygonGeometry | VectorPolygonGeometry>;
/** A Stop Feature */
export type GTFSStopFeature = VectorFeature<Record<string, unknown>, MValue, GTFSStopProperties, VectorPointGeometry> | VectorFeature<undefined, MValue, GTFSStopProperties, VectorPointGeometry>;
/** A GTFS Feature */
export type GTFSFeature = GTFSShapeFeature | GTFSPolyFeature | GTFSStopFeature;
/**
* # GTFS Schedule Reader
*
* ## Description
* Schedule class that pulls in all of the GTFS schedule files and parses them into a single object
* implements the {@link FeatureIterator} interface.
*
* ## Usage
* ```ts
* import { buildGTFSSchedule } from 'gis-tools-ts';
*
* const schedule = await buildGTFSSchedule(gzipData);
*
* for await (const feature of schedule) {
* console.log(feature);
* }
* ```
*
* ## Links
* - https://mobilitydatabase.org
* - https://developers.google.com/transit/gtfs/examples/overview
* - https://gtfs.org/documentation/schedule/reference/#tripstxt
* - https://mobilitydata.github.io/
* - https://www.transit.land
*/
export declare class GTFSScheduleReader implements FeatureIterator {
agencies: Record<string, GTFSAgency>;
areas?: GTFSArea[];
attributions?: Record<string, GTFSAttribution>;
bookingRules?: Record<string, GTFSBookingRule>;
calendar?: GTFSCalendar[];
calendarDates?: GTFSCalendarDate[];
fareAttributes?: Record<string, GTFSFareAttribute>;
fareLegJoinRules?: GTFSFareLegJoinRule[];
fareLegRules?: GTFSFareLegRule[];
fareMedia?: Record<string, GTFSFareMedia>;
fareProducts?: Record<string, GTFSFareProduct>;
fareRules?: GTFSFareRule[];
fareTransferRules?: GTFSFareTransferRule[];
feedInfo?: Record<string, GTFSFeedInfo>;
frequencies?: GTFSFrequency[];
levels?: Record<string, GTFSLevel>;
locationGroups?: Record<string, GTFSLocationGroup>;
locationGroupStops?: GTFSLocationGroupStop[];
networks?: Record<string, GTFSNetwork>;
pathways?: Record<string, GTFSPathway>;
routeNetworks?: GTFSRouteNetwork[];
routes: Record<string, GTFSRoute>;
shapes?: Record<string, VectorFeature<Record<string, unknown>, MValue, GTFSShapeProperties, VectorLineStringGeometry>>;
stopAreas?: GTFSStopArea[];
stops?: Record<string, GTFSStop>;
stopTimes: GTFSStopTime[];
timeframes?: Record<string, GTFSTimeframe>;
transfers?: GTFSTransfer[];
translations?: GTFSTranslation[];
trips: GTFSTrip[];
geojson?: BufferJSONReader<Record<string, unknown>, MValue, GTFSLocationsProperties>;
/** @param pieces - all files */
constructor(pieces: Piece[]);
/**
* TODO: Add proeprties from other files like "color"
* TODO: All features should be parsed as VectorGeometry
* Yields all of the shapes
* @yields {GTFSFeature} - an iterator that contains shapes, stops, location data, and routes
*/
[Symbol.asyncIterator](): AsyncGenerator<GTFSFeature>;
}
/**
* Builds a GTFSScheduleReader from a gzip folder
* @param gzipData - the gzip folder to parse
* @returns - a Schedule class
*/
export declare function buildGTFSSchedule(gzipData: ArrayBufferLike): Promise<GTFSScheduleReader>;
//# sourceMappingURL=index.d.ts.map