minotor 7.0.2 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cspell.json +11 -1
- package/CHANGELOG.md +8 -3
- package/README.md +26 -24
- package/dist/cli.mjs +1243 -267
- package/dist/cli.mjs.map +1 -1
- package/dist/gtfs/transfers.d.ts +13 -4
- package/dist/gtfs/trips.d.ts +12 -7
- package/dist/parser.cjs.js +494 -71
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +494 -71
- package/dist/parser.esm.js.map +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.d.ts +2 -2
- package/dist/router.esm.js +1 -1
- package/dist/router.esm.js.map +1 -1
- package/dist/router.umd.js +1 -1
- package/dist/router.umd.js.map +1 -1
- package/dist/routing/__tests__/plotter.test.d.ts +1 -0
- package/dist/routing/plotter.d.ts +42 -3
- package/dist/routing/result.d.ts +23 -7
- package/dist/routing/route.d.ts +2 -0
- package/dist/routing/router.d.ts +78 -19
- package/dist/timetable/__tests__/tripId.test.d.ts +1 -0
- package/dist/timetable/io.d.ts +4 -2
- package/dist/timetable/proto/timetable.d.ts +13 -1
- package/dist/timetable/route.d.ts +41 -8
- package/dist/timetable/timetable.d.ts +18 -3
- package/dist/timetable/tripId.d.ts +15 -0
- package/package.json +1 -1
- package/src/__e2e__/router.test.ts +114 -105
- package/src/__e2e__/timetable/stops.bin +2 -2
- package/src/__e2e__/timetable/timetable.bin +2 -2
- package/src/cli/repl.ts +259 -1
- package/src/gtfs/__tests__/transfers.test.ts +468 -12
- package/src/gtfs/__tests__/trips.test.ts +350 -28
- package/src/gtfs/parser.ts +16 -4
- package/src/gtfs/transfers.ts +61 -18
- package/src/gtfs/trips.ts +97 -22
- package/src/router.ts +2 -2
- package/src/routing/__tests__/plotter.test.ts +230 -0
- package/src/routing/__tests__/result.test.ts +486 -125
- package/src/routing/__tests__/route.test.ts +7 -3
- package/src/routing/__tests__/router.test.ts +378 -172
- package/src/routing/plotter.ts +279 -48
- package/src/routing/result.ts +114 -34
- package/src/routing/route.ts +0 -3
- package/src/routing/router.ts +332 -211
- package/src/timetable/__tests__/io.test.ts +33 -1
- package/src/timetable/__tests__/route.test.ts +10 -3
- package/src/timetable/__tests__/timetable.test.ts +225 -57
- package/src/timetable/__tests__/tripId.test.ts +27 -0
- package/src/timetable/io.ts +71 -10
- package/src/timetable/proto/timetable.proto +14 -2
- package/src/timetable/proto/timetable.ts +218 -20
- package/src/timetable/route.ts +152 -19
- package/src/timetable/timetable.ts +45 -6
- package/src/timetable/tripId.ts +29 -0
package/dist/gtfs/transfers.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { SourceStopId, StopId } from '../stops/stops.js';
|
|
2
2
|
import { ServiceRouteId, Transfer } from '../timetable/timetable.js';
|
|
3
3
|
import { GtfsStopsMap } from './stops.js';
|
|
4
|
-
import {
|
|
4
|
+
import { GtfsTripId } from './trips.js';
|
|
5
5
|
export type GtfsTransferType = 0 | 1 | 2 | 3 | 4 | 5;
|
|
6
6
|
export type TransfersMap = Map<StopId, Transfer[]>;
|
|
7
|
+
export type GtfsTripBoarding = {
|
|
8
|
+
fromTrip: GtfsTripId;
|
|
9
|
+
toTrip: GtfsTripId;
|
|
10
|
+
hopOnStop: StopId;
|
|
11
|
+
};
|
|
12
|
+
export type TripContinuationsMap = Map<StopId, GtfsTripBoarding[]>;
|
|
7
13
|
export type TransferEntry = {
|
|
8
14
|
from_stop_id?: SourceStopId;
|
|
9
15
|
to_stop_id?: SourceStopId;
|
|
10
|
-
from_trip_id?:
|
|
11
|
-
to_trip_id?:
|
|
16
|
+
from_trip_id?: GtfsTripId;
|
|
17
|
+
to_trip_id?: GtfsTripId;
|
|
12
18
|
from_route_id?: ServiceRouteId;
|
|
13
19
|
to_route_id?: ServiceRouteId;
|
|
14
20
|
transfer_type: GtfsTransferType;
|
|
@@ -20,4 +26,7 @@ export type TransferEntry = {
|
|
|
20
26
|
* @param stopsStream The readable stream containing the stops data.
|
|
21
27
|
* @return A mapping of stop IDs to corresponding stop details.
|
|
22
28
|
*/
|
|
23
|
-
export declare const parseTransfers: (transfersStream: NodeJS.ReadableStream, stopsMap: GtfsStopsMap) => Promise<
|
|
29
|
+
export declare const parseTransfers: (transfersStream: NodeJS.ReadableStream, stopsMap: GtfsStopsMap) => Promise<{
|
|
30
|
+
transfers: TransfersMap;
|
|
31
|
+
tripContinuations: TripContinuationsMap;
|
|
32
|
+
}>;
|
package/dist/gtfs/trips.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { StopId } from '../stops/stops.js';
|
|
2
|
-
import { Route } from '../timetable/route.js';
|
|
2
|
+
import { Route, RouteId, TripRouteIndex } from '../timetable/route.js';
|
|
3
3
|
import { ServiceRoute, ServiceRouteId, StopAdjacency } from '../timetable/timetable.js';
|
|
4
4
|
import { GtfsRouteId, GtfsRoutesMap } from './routes.js';
|
|
5
5
|
import { ServiceIds } from './services.js';
|
|
6
6
|
import { GtfsStopsMap } from './stops.js';
|
|
7
|
-
import { TransfersMap } from './transfers.js';
|
|
8
|
-
export type
|
|
9
|
-
export type
|
|
7
|
+
import { TransfersMap, TripContinuationsMap } from './transfers.js';
|
|
8
|
+
export type GtfsTripId = string;
|
|
9
|
+
export type GtfsTripIdsMap = Map<GtfsTripId, GtfsRouteId>;
|
|
10
|
+
export type TripsMapping = Map<GtfsTripId, {
|
|
11
|
+
routeId: RouteId;
|
|
12
|
+
tripRouteIndex: TripRouteIndex;
|
|
13
|
+
}>;
|
|
10
14
|
export type GtfsPickupDropOffType = '' | '0' | '1' | '2' | '3';
|
|
11
15
|
export type SerializedPickUpDropOffType = 0 | 1 | 2 | 3;
|
|
12
16
|
/**
|
|
@@ -22,8 +26,8 @@ export declare const encodePickUpDropOffTypes: (pickUpTypes: SerializedPickUpDro
|
|
|
22
26
|
* @param serviceRoutes A mapping of route IDs to route details.
|
|
23
27
|
* @returns A mapping of trip IDs to corresponding route IDs.
|
|
24
28
|
*/
|
|
25
|
-
export declare const parseTrips: (tripsStream: NodeJS.ReadableStream, serviceIds: ServiceIds, validGtfsRoutes: GtfsRoutesMap) => Promise<
|
|
26
|
-
export declare const buildStopsAdjacencyStructure: (serviceRoutes: ServiceRoute[], routes: Route[], transfersMap: TransfersMap, nbStops: number, activeStops: Set<StopId>) => StopAdjacency[];
|
|
29
|
+
export declare const parseTrips: (tripsStream: NodeJS.ReadableStream, serviceIds: ServiceIds, validGtfsRoutes: GtfsRoutesMap) => Promise<GtfsTripIdsMap>;
|
|
30
|
+
export declare const buildStopsAdjacencyStructure: (tripsMapping: TripsMapping, serviceRoutes: ServiceRoute[], routes: Route[], transfersMap: TransfersMap, tripContinuationsMap: TripContinuationsMap, nbStops: number, activeStops: Set<StopId>) => StopAdjacency[];
|
|
27
31
|
/**
|
|
28
32
|
* Parses the stop_times.txt data from a GTFS feed.
|
|
29
33
|
*
|
|
@@ -33,7 +37,8 @@ export declare const buildStopsAdjacencyStructure: (serviceRoutes: ServiceRoute[
|
|
|
33
37
|
* @param activeStopIds A set of valid stop IDs.
|
|
34
38
|
* @returns A mapping of route IDs to route details. The routes returned correspond to the set of trips from GTFS that share the same stop list.
|
|
35
39
|
*/
|
|
36
|
-
export declare const parseStopTimes: (stopTimesStream: NodeJS.ReadableStream, stopsMap: GtfsStopsMap, activeTripIds:
|
|
40
|
+
export declare const parseStopTimes: (stopTimesStream: NodeJS.ReadableStream, stopsMap: GtfsStopsMap, activeTripIds: GtfsTripIdsMap, activeStopIds: Set<StopId>) => Promise<{
|
|
37
41
|
routes: Route[];
|
|
38
42
|
serviceRoutesMap: Map<GtfsRouteId, ServiceRouteId>;
|
|
43
|
+
tripsMapping: TripsMapping;
|
|
39
44
|
}>;
|