minotor 10.0.1 → 10.1.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 +64 -42
- package/CHANGELOG.md +3 -3
- package/LICENSE +1 -1
- package/README.md +5 -4
- package/dist/cli.mjs +120 -42
- package/dist/cli.mjs.map +1 -1
- package/dist/gtfs/profiles/extended.d.ts +2 -0
- package/dist/gtfs/profiles/standard.d.ts +1 -1
- package/dist/parser.cjs.js +119 -41
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.d.ts +3 -2
- package/dist/parser.esm.js +118 -41
- package/dist/parser.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/minotor.ts +13 -3
- package/src/gtfs/parser.ts +2 -2
- package/src/gtfs/profiles/__tests__/extended.test.ts +15 -0
- package/src/gtfs/profiles/extended.ts +146 -0
- package/src/gtfs/profiles/standard.ts +1 -1
- package/src/gtfs/routes.ts +2 -2
- package/src/parser.ts +3 -2
- package/dist/gtfs/profiles/ch.d.ts +0 -2
- package/src/gtfs/profiles/__tests__/ch.test.ts +0 -15
- package/src/gtfs/profiles/ch.ts +0 -53
- /package/dist/gtfs/profiles/__tests__/{ch.test.d.ts → extended.test.d.ts} +0 -0
package/.cspell.json
CHANGED
|
@@ -2,58 +2,80 @@
|
|
|
2
2
|
"version": "0.2",
|
|
3
3
|
"language": "en",
|
|
4
4
|
"words": [
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"GTFS",
|
|
11
|
-
"Tilleul",
|
|
12
|
-
"Cathédrale",
|
|
13
|
-
"tcrqn",
|
|
14
|
-
"tcrqo",
|
|
15
|
-
"lswfbh",
|
|
16
|
-
"Neuveville",
|
|
17
|
-
"Cathedrale",
|
|
5
|
+
"alightable",
|
|
6
|
+
"Ascenseur",
|
|
7
|
+
"Aufzug",
|
|
8
|
+
"bgcolor",
|
|
9
|
+
"boardable",
|
|
18
10
|
"bufbuild",
|
|
19
|
-
"
|
|
11
|
+
"Bulle",
|
|
12
|
+
"catchable",
|
|
13
|
+
"Cathedrale",
|
|
14
|
+
"Cathédrale",
|
|
15
|
+
"Davos",
|
|
16
|
+
"Delling",
|
|
17
|
+
"Dolderbahn",
|
|
18
|
+
"dolmuş",
|
|
19
|
+
"dropoff",
|
|
20
|
+
"Dymchurch",
|
|
21
|
+
"Engadin",
|
|
22
|
+
"Eurostar",
|
|
23
|
+
"fontname",
|
|
24
|
+
"Francey",
|
|
25
|
+
"funi",
|
|
26
|
+
"gare",
|
|
27
|
+
"Gatwick",
|
|
20
28
|
"geokdbush",
|
|
21
|
-
"kdbush",
|
|
22
|
-
"slimsearch",
|
|
23
29
|
"geospatial",
|
|
24
|
-
"
|
|
30
|
+
"GNER",
|
|
31
|
+
"graphviz",
|
|
32
|
+
"Gruyères",
|
|
33
|
+
"GTFS",
|
|
34
|
+
"Gtfs",
|
|
35
|
+
"gtfs",
|
|
36
|
+
"Haut",
|
|
37
|
+
"Heathrow",
|
|
38
|
+
"Hythe",
|
|
39
|
+
"isochrone",
|
|
40
|
+
"kdbush",
|
|
41
|
+
"Klosters",
|
|
25
42
|
"Ksfdp",
|
|
26
|
-
"Tsvg",
|
|
27
43
|
"Landquart",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
44
|
+
"lswfbh",
|
|
45
|
+
"luxon",
|
|
46
|
+
"Marshrutka",
|
|
47
|
+
"Métro",
|
|
48
|
+
"Minotor",
|
|
49
|
+
"minotor",
|
|
34
50
|
"Moléson",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"gare",
|
|
38
|
-
"funi",
|
|
39
|
-
"Francey",
|
|
40
|
-
"téléphérique",
|
|
51
|
+
"moleson",
|
|
52
|
+
"Montjuïc",
|
|
41
53
|
"Moritz",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
54
|
+
"Naye",
|
|
55
|
+
"NeTEx",
|
|
56
|
+
"Neuveville",
|
|
57
|
+
"nodesep",
|
|
44
58
|
"Olten",
|
|
45
|
-
"
|
|
59
|
+
"penwidth",
|
|
60
|
+
"protoc",
|
|
46
61
|
"rankdir",
|
|
47
|
-
"bgcolor",
|
|
48
|
-
"nodesep",
|
|
49
62
|
"ranksep",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
63
|
+
"Regio",
|
|
64
|
+
"Regionalzug",
|
|
65
|
+
"Rhin",
|
|
66
|
+
"Rigiblick",
|
|
67
|
+
"Rochers",
|
|
68
|
+
"Roissy",
|
|
69
|
+
"slimsearch",
|
|
70
|
+
"tcrqn",
|
|
71
|
+
"tcrqo",
|
|
72
|
+
"Telecabin",
|
|
73
|
+
"Telefèric",
|
|
74
|
+
"téléphérique",
|
|
75
|
+
"Tilleul",
|
|
76
|
+
"Tpng",
|
|
77
|
+
"Tsvg",
|
|
78
|
+
"Wokingham"
|
|
57
79
|
],
|
|
58
80
|
"flagWords": [],
|
|
59
81
|
"ignorePaths": [
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# [10.1.0](https://github.com/aubryio/minotor/compare/v10.0.1...v10.1.0) (2026-01-26)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* improved extended gtfs support ([#60](https://github.com/aubryio/minotor/issues/60)) ([5fe7d6f](https://github.com/aubryio/minotor/commit/5fe7d6f91cff2aa98b8304d11ba18ea77bdd5444))
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ A more complete isochrone map showcase can be found on [isochrone.ch](https://is
|
|
|
42
42
|
|
|
43
43
|
| Feed | Parsing time | Timetable Size for a Day (Compressed) |
|
|
44
44
|
| ------------------------------------------------------------------------------------------ | ------------ | ------------------------------------- |
|
|
45
|
-
| [Swiss GTFS feed](https://data.opentransportdata.swiss/en/dataset/timetable-
|
|
45
|
+
| [Swiss GTFS feed](https://data.opentransportdata.swiss/en/dataset/timetable-2026-gtfs2020) | ~2 minutes | 20 MB (5MB) |
|
|
46
46
|
|
|
47
47
|
## Get started
|
|
48
48
|
|
|
@@ -55,10 +55,11 @@ A more complete isochrone map showcase can be found on [isochrone.ch](https://is
|
|
|
55
55
|
#### GTFS Feed parsing (Node.js only)
|
|
56
56
|
|
|
57
57
|
```
|
|
58
|
-
import { GtfsParser,
|
|
58
|
+
import { GtfsParser, extendedGtfsProfile } from 'minotor/parser';
|
|
59
59
|
|
|
60
|
-
const parser = new GtfsParser('gtfs-feed.zip',
|
|
61
|
-
const
|
|
60
|
+
const parser = new GtfsParser('gtfs-feed.zip', extendedGtfsProfile);
|
|
61
|
+
const timetable = await parser.parseTimetable(new Date());
|
|
62
|
+
const stopsIndex = await parser.parseStops();
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
Note that times are only represented at the minute level so they can fit on 16 bits.
|
package/dist/cli.mjs
CHANGED
|
@@ -18153,7 +18153,7 @@ class Timetable {
|
|
|
18153
18153
|
}
|
|
18154
18154
|
}
|
|
18155
18155
|
|
|
18156
|
-
const
|
|
18156
|
+
const standardGtfsProfile = {
|
|
18157
18157
|
routeTypeParser: (routeType) => {
|
|
18158
18158
|
switch (routeType) {
|
|
18159
18159
|
case 0:
|
|
@@ -20121,7 +20121,7 @@ const parseCsv = (stream, numericColumns = []) => {
|
|
|
20121
20121
|
* @param profile A configuration object defining the specificities of the GTFS feed.
|
|
20122
20122
|
* @returns A map of all the valid routes.
|
|
20123
20123
|
*/
|
|
20124
|
-
const parseRoutes = (routesStream_1, ...args_1) => __awaiter(void 0, [routesStream_1, ...args_1], void 0, function* (routesStream, profile =
|
|
20124
|
+
const parseRoutes = (routesStream_1, ...args_1) => __awaiter(void 0, [routesStream_1, ...args_1], void 0, function* (routesStream, profile = standardGtfsProfile) {
|
|
20125
20125
|
var _a, e_1, _b, _c;
|
|
20126
20126
|
const routes = new Map();
|
|
20127
20127
|
try {
|
|
@@ -20937,7 +20937,7 @@ const STOP_TIMES_FILE = 'stop_times.txt';
|
|
|
20937
20937
|
const STOPS_FILE = 'stops.txt';
|
|
20938
20938
|
const TRANSFERS_FILE = 'transfers.txt';
|
|
20939
20939
|
class GtfsParser {
|
|
20940
|
-
constructor(path, profile =
|
|
20940
|
+
constructor(path, profile = standardGtfsProfile) {
|
|
20941
20941
|
// TODO: support input from multiple sources
|
|
20942
20942
|
this.path = path;
|
|
20943
20943
|
this.profile = profile;
|
|
@@ -21056,51 +21056,128 @@ class GtfsParser {
|
|
|
21056
21056
|
}
|
|
21057
21057
|
|
|
21058
21058
|
/**
|
|
21059
|
-
* Parses the
|
|
21060
|
-
*
|
|
21059
|
+
* Parses the extended GTFS route type and returns the corresponding basic GTFS route type.
|
|
21060
|
+
* Based on the GTFS Extended Route Types specification.
|
|
21061
|
+
* @see https://developers.google.com/transit/gtfs/reference/extended-route-types
|
|
21062
|
+
* @param routeType The extended route type to parse.
|
|
21061
21063
|
* @returns The corresponding GTFS route type, or undefined if the route type is not recognized.
|
|
21062
21064
|
*/
|
|
21063
21065
|
const routeTypeParser = (routeType) => {
|
|
21064
21066
|
switch (routeType) {
|
|
21065
|
-
|
|
21066
|
-
case
|
|
21067
|
-
|
|
21068
|
-
case
|
|
21069
|
-
case
|
|
21070
|
-
case
|
|
21071
|
-
case
|
|
21072
|
-
case
|
|
21073
|
-
case
|
|
21074
|
-
case
|
|
21075
|
-
|
|
21076
|
-
case
|
|
21077
|
-
|
|
21078
|
-
case
|
|
21079
|
-
|
|
21080
|
-
case
|
|
21081
|
-
|
|
21082
|
-
case
|
|
21083
|
-
|
|
21084
|
-
|
|
21085
|
-
|
|
21086
|
-
case
|
|
21087
|
-
case
|
|
21088
|
-
case
|
|
21089
|
-
case
|
|
21090
|
-
case
|
|
21091
|
-
case
|
|
21092
|
-
case
|
|
21093
|
-
case
|
|
21094
|
-
case
|
|
21095
|
-
case
|
|
21096
|
-
return '
|
|
21097
|
-
|
|
21098
|
-
case
|
|
21067
|
+
// Railway Service (100-199)
|
|
21068
|
+
case 100: // Railway Service
|
|
21069
|
+
case 101: // High Speed Rail Service (TGV, ICE, Eurostar)
|
|
21070
|
+
case 102: // Long Distance Trains (InterCity/EuroCity)
|
|
21071
|
+
case 103: // Inter Regional Rail Service (InterRegio, Cross County Rail)
|
|
21072
|
+
case 104: // Car Transport Rail Service
|
|
21073
|
+
case 105: // Sleeper Rail Service (GNER Sleeper)
|
|
21074
|
+
case 106: // Regional Rail Service (TER, Regionalzug)
|
|
21075
|
+
case 107: // Tourist Railway Service (Romney, Hythe & Dymchurch)
|
|
21076
|
+
case 108: // Rail Shuttle (Within Complex) (Gatwick Shuttle, Sky Line)
|
|
21077
|
+
case 109: // Suburban Railway (S-Bahn, RER, S-tog)
|
|
21078
|
+
case 110: // Replacement Rail Service
|
|
21079
|
+
case 111: // Special Rail Service
|
|
21080
|
+
case 112: // Lorry Transport Rail Service
|
|
21081
|
+
case 113: // All Rail Services
|
|
21082
|
+
case 114: // Cross-Country Rail Service
|
|
21083
|
+
case 115: // Vehicle Transport Rail Service
|
|
21084
|
+
case 116: // Rack and Pinion Railway (Rochers de Naye, Dolderbahn)
|
|
21085
|
+
case 117: // Additional Rail Service
|
|
21086
|
+
return 'RAIL';
|
|
21087
|
+
// Coach Service (200-299)
|
|
21088
|
+
case 200: // Coach Service
|
|
21089
|
+
case 201: // International Coach Service (EuroLine, Touring)
|
|
21090
|
+
case 202: // National Coach Service (National Express)
|
|
21091
|
+
case 203: // Shuttle Coach Service (Roissy Bus)
|
|
21092
|
+
case 204: // Regional Coach Service
|
|
21093
|
+
case 205: // Special Coach Service
|
|
21094
|
+
case 206: // Sightseeing Coach Service
|
|
21095
|
+
case 207: // Tourist Coach Service
|
|
21096
|
+
case 208: // Commuter Coach Service
|
|
21097
|
+
case 209: // All Coach Services
|
|
21098
|
+
return 'BUS';
|
|
21099
|
+
// Urban Railway Service (400-499)
|
|
21100
|
+
case 400: // Urban Railway Service
|
|
21101
|
+
case 401: // Metro Service (Métro de Paris)
|
|
21102
|
+
case 402: // Underground Service (London Underground, U-Bahn)
|
|
21103
|
+
case 403: // Urban Railway Service
|
|
21104
|
+
case 404: // All Urban Railway Services
|
|
21105
|
+
return 'SUBWAY';
|
|
21106
|
+
case 405: // Monorail
|
|
21107
|
+
return 'MONORAIL';
|
|
21108
|
+
// Bus Service (700-799)
|
|
21109
|
+
case 700: // Bus Service
|
|
21110
|
+
case 701: // Regional Bus Service (Eastbourne-Maidstone)
|
|
21111
|
+
case 702: // Express Bus Service (X19 Wokingham-Heathrow)
|
|
21112
|
+
case 703: // Stopping Bus Service
|
|
21113
|
+
case 704: // Local Bus Service
|
|
21114
|
+
case 705: // Night Bus Service
|
|
21115
|
+
case 706: // Post Bus Service
|
|
21116
|
+
case 707: // Special Needs Bus
|
|
21117
|
+
case 708: // Mobility Bus Service
|
|
21118
|
+
case 709: // Mobility Bus for Registered Disabled
|
|
21119
|
+
case 710: // Sightseeing Bus
|
|
21120
|
+
case 711: // Shuttle Bus (747 Heathrow-Gatwick)
|
|
21121
|
+
case 712: // School Bus
|
|
21122
|
+
case 713: // School and Public Service Bus
|
|
21123
|
+
case 714: // Rail Replacement Bus Service
|
|
21124
|
+
case 715: // Demand and Response Bus Service
|
|
21125
|
+
case 716: // All Bus Services
|
|
21126
|
+
return 'BUS';
|
|
21127
|
+
// Trolleybus Service (800-899)
|
|
21128
|
+
case 800: // Trolleybus Service
|
|
21129
|
+
return 'TROLLEYBUS';
|
|
21130
|
+
// Tram Service (900-999)
|
|
21131
|
+
case 900: // Tram Service
|
|
21132
|
+
case 901: // City Tram Service
|
|
21133
|
+
case 902: // Local Tram Service (Munich, Brussels, Croydon)
|
|
21134
|
+
case 903: // Regional Tram Service
|
|
21135
|
+
case 904: // Sightseeing Tram Service (Blackpool Seafront)
|
|
21136
|
+
case 905: // Shuttle Tram Service
|
|
21137
|
+
case 906: // All Tram Services
|
|
21138
|
+
return 'TRAM';
|
|
21139
|
+
// Water Transport Service (1000-1099)
|
|
21140
|
+
case 1000: // Water Transport Service
|
|
21141
|
+
return 'FERRY';
|
|
21142
|
+
// Air Service (1100-1199)
|
|
21143
|
+
case 1100: // Air Service
|
|
21144
|
+
return undefined;
|
|
21145
|
+
// Ferry Service (1200-1299)
|
|
21146
|
+
case 1200: // Ferry Service
|
|
21147
|
+
return 'FERRY';
|
|
21148
|
+
// Aerial Lift Service (1300-1399)
|
|
21149
|
+
case 1300: // Aerial Lift Service (Telefèric de Montjuïc, Roosevelt Island Tramway)
|
|
21150
|
+
case 1301: // Telecabin Service
|
|
21151
|
+
case 1302: // Cable Car Service
|
|
21152
|
+
case 1304: // Chair Lift Service
|
|
21153
|
+
case 1305: // Drag Lift Service
|
|
21154
|
+
case 1306: // Small Telecabin Service
|
|
21155
|
+
case 1307: // All Telecabin Services
|
|
21156
|
+
return 'AERIAL_LIFT';
|
|
21157
|
+
case 1303: // Elevator Service (Ascenseur, Aufzug)
|
|
21158
|
+
case 1400: // Funicular Service (Rigiblick)
|
|
21159
|
+
return 'FUNICULAR';
|
|
21160
|
+
// Taxi Service (1500-1599)
|
|
21161
|
+
case 1500: // Taxi Service
|
|
21162
|
+
case 1502: // Water Taxi Service
|
|
21163
|
+
case 1503: // Rail Taxi Service
|
|
21164
|
+
case 1504: // Bike Taxi Service
|
|
21165
|
+
case 1505: // Licensed Taxi Service
|
|
21166
|
+
case 1506: // Private Hire Service Vehicle
|
|
21167
|
+
case 1507: // All Taxi Services
|
|
21168
|
+
return undefined;
|
|
21169
|
+
case 1501: // Communal Taxi Service (Marshrutka, dolmuş)
|
|
21170
|
+
return 'BUS';
|
|
21171
|
+
// Miscellaneous Service (1700-1799)
|
|
21172
|
+
case 1700: // Miscellaneous Service / Unknown mode
|
|
21173
|
+
return undefined;
|
|
21174
|
+
case 1702: // Horse-drawn Carriage
|
|
21175
|
+
return 'BUS';
|
|
21099
21176
|
default:
|
|
21100
21177
|
return undefined;
|
|
21101
21178
|
}
|
|
21102
21179
|
};
|
|
21103
|
-
const
|
|
21180
|
+
const extendedGtfsProfile = {
|
|
21104
21181
|
routeTypeParser,
|
|
21105
21182
|
};
|
|
21106
21183
|
|
|
@@ -22744,7 +22821,8 @@ const startRepl = (stopsPath, timetablePath) => {
|
|
|
22744
22821
|
|
|
22745
22822
|
const program = new Command();
|
|
22746
22823
|
const profiles = {
|
|
22747
|
-
|
|
22824
|
+
extended: extendedGtfsProfile,
|
|
22825
|
+
standard: standardGtfsProfile,
|
|
22748
22826
|
};
|
|
22749
22827
|
program
|
|
22750
22828
|
.name('minotor')
|
|
@@ -22757,7 +22835,7 @@ program
|
|
|
22757
22835
|
.option('-d, --date <date>', 'Date of the day to parse in yyyy-MM-dd format', DateTime.now().toFormat('yyyy-MM-dd'))
|
|
22758
22836
|
.option('-t, --timetableOutputPath <path>', 'Path to output timetable file', '/tmp/timetable')
|
|
22759
22837
|
.option('-s, --stopsOutputPath <path>', 'Path to output stops file', '/tmp/stops')
|
|
22760
|
-
.option('-p, --profileName <name>', 'Profile name for GTFS config', '
|
|
22838
|
+
.option('-p, --profileName <name>', 'Profile name for GTFS config', 'extended')
|
|
22761
22839
|
.option('-v, --verbose', 'Verbose mode', false)
|
|
22762
22840
|
.action((gtfsPath, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22763
22841
|
if (options.verbose) {
|