gtfs 4.15.8 → 4.15.10
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/README.md +13 -15
- package/dist/bin/gtfs-export.js +21 -128
- package/dist/bin/gtfs-export.js.map +1 -1
- package/dist/bin/gtfs-import.js +81 -147
- package/dist/bin/gtfs-import.js.map +1 -1
- package/dist/bin/gtfsrealtime-update.js +0 -15
- package/dist/bin/gtfsrealtime-update.js.map +1 -1
- package/dist/index.js +83 -160
- package/dist/index.js.map +1 -1
- package/dist/models/models.d.ts +0 -42
- package/dist/models/models.js +19 -100
- package/dist/models/models.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -167,8 +167,6 @@ Copy `config-sample.json` to `config.json` and then add your projects configurat
|
|
|
167
167
|
|
|
168
168
|
For GTFS files that contain more than one agency, you only need to list each GTFS file once in the `agencies` array, not once per agency that it contains.
|
|
169
169
|
|
|
170
|
-
To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com).
|
|
171
|
-
|
|
172
170
|
#### agencies options
|
|
173
171
|
|
|
174
172
|
| option | type | description |
|
|
@@ -188,7 +186,7 @@ To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com)
|
|
|
188
186
|
{
|
|
189
187
|
"agencies": [
|
|
190
188
|
{
|
|
191
|
-
"url": "https://
|
|
189
|
+
"url": "https://www.bart.gov/dev/schedules/google_transit.zip"
|
|
192
190
|
}
|
|
193
191
|
]
|
|
194
192
|
}
|
|
@@ -200,7 +198,7 @@ To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com)
|
|
|
200
198
|
{
|
|
201
199
|
"agencies": [
|
|
202
200
|
{
|
|
203
|
-
"url": "https://
|
|
201
|
+
"url": "https://www.bart.gov/dev/schedules/google_transit.zip",
|
|
204
202
|
"headers": {
|
|
205
203
|
"Content-Type": "application/json",
|
|
206
204
|
"Authorization": "bearer 1234567890"
|
|
@@ -253,21 +251,21 @@ To find an agency's GTFS file, visit [transitfeeds.com](http://transitfeeds.com)
|
|
|
253
251
|
{
|
|
254
252
|
"agencies": [
|
|
255
253
|
{
|
|
256
|
-
"url": "https://
|
|
254
|
+
"url": "https://www.bart.gov/dev/schedules/google_transit.zip",
|
|
257
255
|
"realtimeAlerts": {
|
|
258
|
-
"url": "https://
|
|
256
|
+
"url": "https://api.bart.gov/gtfsrt/alerts.aspx",
|
|
259
257
|
"headers": {
|
|
260
258
|
"Authorization": "bearer 123456789"
|
|
261
259
|
}
|
|
262
260
|
},
|
|
263
261
|
"realtimeTripUpdates": {
|
|
264
|
-
"url": "https://
|
|
262
|
+
"url": "https://api.bart.gov/gtfsrt/tripupdate.aspx",
|
|
265
263
|
"headers": {
|
|
266
264
|
"Authorization": "bearer 123456789"
|
|
267
265
|
}
|
|
268
266
|
},
|
|
269
267
|
"realtimeVehiclePositions": {
|
|
270
|
-
"url": "https://
|
|
268
|
+
"url": "https://api.bart.gov/gtfsrt/vehiclepositions.aspx",
|
|
271
269
|
"headers": {
|
|
272
270
|
"Authorization": "bearer 123456789"
|
|
273
271
|
}
|
|
@@ -400,15 +398,15 @@ importGtfs({
|
|
|
400
398
|
{
|
|
401
399
|
"agencies": [
|
|
402
400
|
{
|
|
403
|
-
"url": "https://
|
|
401
|
+
"url": "https://www.bart.gov/dev/schedules/google_transit.zip",
|
|
404
402
|
"realtimeAlerts": {
|
|
405
|
-
"url": "https://
|
|
403
|
+
"url": "https://api.bart.gov/gtfsrt/alerts.aspx"
|
|
406
404
|
},
|
|
407
405
|
"realtimeTripUpdates": {
|
|
408
|
-
"url": "https://
|
|
406
|
+
"url": "https://api.bart.gov/gtfsrt/tripupdate.aspx"
|
|
409
407
|
},
|
|
410
408
|
"realtimeVehiclePositions": {
|
|
411
|
-
"url": "https://
|
|
409
|
+
"url": "https://api.bart.gov/gtfsrt/vehiclepositions.aspx"
|
|
412
410
|
}
|
|
413
411
|
}
|
|
414
412
|
],
|
|
@@ -477,7 +475,7 @@ import { importGtfs } from 'gtfs';
|
|
|
477
475
|
const config = {
|
|
478
476
|
agencies: [
|
|
479
477
|
{
|
|
480
|
-
url: 'https://
|
|
478
|
+
url: 'https://www.bart.gov/dev/schedules/google_transit.zip',
|
|
481
479
|
exclude: ['shapes'],
|
|
482
480
|
},
|
|
483
481
|
],
|
|
@@ -527,7 +525,7 @@ const config = {
|
|
|
527
525
|
sqlitePath: '/dev/sqlite/gtfs',
|
|
528
526
|
agencies: [
|
|
529
527
|
{
|
|
530
|
-
url: 'https://
|
|
528
|
+
url: 'https://www.bart.gov/dev/schedules/google_transit.zip',
|
|
531
529
|
exclude: ['shapes'],
|
|
532
530
|
},
|
|
533
531
|
],
|
|
@@ -607,7 +605,7 @@ const config = {
|
|
|
607
605
|
sqlitePath: '/dev/sqlite/gtfs',
|
|
608
606
|
agencies: [
|
|
609
607
|
{
|
|
610
|
-
url: 'https://
|
|
608
|
+
url: 'https://www.bart.gov/dev/schedules/google_transit.zip',
|
|
611
609
|
exclude: ['shapes'],
|
|
612
610
|
},
|
|
613
611
|
],
|
package/dist/bin/gtfs-export.js
CHANGED
|
@@ -346,12 +346,7 @@ var bookingRules = {
|
|
|
346
346
|
},
|
|
347
347
|
{
|
|
348
348
|
name: "prior_notice_last_time",
|
|
349
|
-
type: "
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
name: "prior_notice_last_timestamp",
|
|
353
|
-
type: "integer",
|
|
354
|
-
index: true
|
|
349
|
+
type: "time"
|
|
355
350
|
},
|
|
356
351
|
{
|
|
357
352
|
name: "prior_notice_start_day",
|
|
@@ -360,12 +355,7 @@ var bookingRules = {
|
|
|
360
355
|
},
|
|
361
356
|
{
|
|
362
357
|
name: "prior_notice_start_time",
|
|
363
|
-
type: "
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
name: "prior_notice_start_timestamp",
|
|
367
|
-
type: "integer",
|
|
368
|
-
index: true
|
|
358
|
+
type: "time"
|
|
369
359
|
},
|
|
370
360
|
{
|
|
371
361
|
name: "prior_notice_service_id",
|
|
@@ -831,23 +821,15 @@ var frequencies = {
|
|
|
831
821
|
},
|
|
832
822
|
{
|
|
833
823
|
name: "start_time",
|
|
834
|
-
type: "
|
|
824
|
+
type: "time",
|
|
835
825
|
required: true,
|
|
836
826
|
primary: true
|
|
837
827
|
},
|
|
838
|
-
{
|
|
839
|
-
name: "start_timestamp",
|
|
840
|
-
type: "integer"
|
|
841
|
-
},
|
|
842
828
|
{
|
|
843
829
|
name: "end_time",
|
|
844
|
-
type: "
|
|
830
|
+
type: "time",
|
|
845
831
|
required: true
|
|
846
832
|
},
|
|
847
|
-
{
|
|
848
|
-
name: "end_timestamp",
|
|
849
|
-
type: "integer"
|
|
850
|
-
},
|
|
851
833
|
{
|
|
852
834
|
name: "headway_secs",
|
|
853
835
|
type: "integer",
|
|
@@ -1214,21 +1196,11 @@ var stopTimes = {
|
|
|
1214
1196
|
},
|
|
1215
1197
|
{
|
|
1216
1198
|
name: "arrival_time",
|
|
1217
|
-
type: "
|
|
1218
|
-
},
|
|
1219
|
-
{
|
|
1220
|
-
name: "arrival_timestamp",
|
|
1221
|
-
type: "integer",
|
|
1222
|
-
index: true
|
|
1199
|
+
type: "time"
|
|
1223
1200
|
},
|
|
1224
1201
|
{
|
|
1225
1202
|
name: "departure_time",
|
|
1226
|
-
type: "
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
name: "departure_timestamp",
|
|
1230
|
-
type: "integer",
|
|
1231
|
-
index: true
|
|
1203
|
+
type: "time"
|
|
1232
1204
|
},
|
|
1233
1205
|
{
|
|
1234
1206
|
name: "location_group_id",
|
|
@@ -1263,12 +1235,7 @@ var stopTimes = {
|
|
|
1263
1235
|
},
|
|
1264
1236
|
{
|
|
1265
1237
|
name: "start_pickup_drop_off_window",
|
|
1266
|
-
type: "
|
|
1267
|
-
},
|
|
1268
|
-
{
|
|
1269
|
-
name: "start_pickup_drop_off_window_timestamp",
|
|
1270
|
-
type: "integer",
|
|
1271
|
-
index: true
|
|
1238
|
+
type: "time"
|
|
1272
1239
|
},
|
|
1273
1240
|
{
|
|
1274
1241
|
name: "pickup_type",
|
|
@@ -1418,12 +1385,12 @@ var timeframes = {
|
|
|
1418
1385
|
},
|
|
1419
1386
|
{
|
|
1420
1387
|
name: "start_time",
|
|
1421
|
-
type: "
|
|
1388
|
+
type: "time",
|
|
1422
1389
|
primary: true
|
|
1423
1390
|
},
|
|
1424
1391
|
{
|
|
1425
1392
|
name: "end_time",
|
|
1426
|
-
type: "
|
|
1393
|
+
type: "time",
|
|
1427
1394
|
primary: true
|
|
1428
1395
|
},
|
|
1429
1396
|
{
|
|
@@ -1696,19 +1663,11 @@ var timetables = {
|
|
|
1696
1663
|
},
|
|
1697
1664
|
{
|
|
1698
1665
|
name: "start_time",
|
|
1699
|
-
type: "
|
|
1700
|
-
},
|
|
1701
|
-
{
|
|
1702
|
-
name: "start_timestamp",
|
|
1703
|
-
type: "integer"
|
|
1666
|
+
type: "time"
|
|
1704
1667
|
},
|
|
1705
1668
|
{
|
|
1706
1669
|
name: "end_time",
|
|
1707
|
-
type: "
|
|
1708
|
-
},
|
|
1709
|
-
{
|
|
1710
|
-
name: "end_timestamp",
|
|
1711
|
-
type: "integer"
|
|
1670
|
+
type: "time"
|
|
1712
1671
|
},
|
|
1713
1672
|
{
|
|
1714
1673
|
name: "timetable_label",
|
|
@@ -2148,21 +2107,11 @@ var boardAlight = {
|
|
|
2148
2107
|
},
|
|
2149
2108
|
{
|
|
2150
2109
|
name: "service_arrival_time",
|
|
2151
|
-
type: "
|
|
2152
|
-
},
|
|
2153
|
-
{
|
|
2154
|
-
name: "service_arrival_timestamp",
|
|
2155
|
-
type: "integer",
|
|
2156
|
-
index: true
|
|
2110
|
+
type: "time"
|
|
2157
2111
|
},
|
|
2158
2112
|
{
|
|
2159
2113
|
name: "service_departure_time",
|
|
2160
|
-
type: "
|
|
2161
|
-
},
|
|
2162
|
-
{
|
|
2163
|
-
name: "service_departure_timestamp",
|
|
2164
|
-
type: "integer",
|
|
2165
|
-
index: true
|
|
2114
|
+
type: "time"
|
|
2166
2115
|
},
|
|
2167
2116
|
{
|
|
2168
2117
|
name: "source",
|
|
@@ -2229,21 +2178,11 @@ var riderTrip = {
|
|
|
2229
2178
|
},
|
|
2230
2179
|
{
|
|
2231
2180
|
name: "boarding_time",
|
|
2232
|
-
type: "
|
|
2233
|
-
},
|
|
2234
|
-
{
|
|
2235
|
-
name: "boarding_timestamp",
|
|
2236
|
-
type: "integer",
|
|
2237
|
-
index: true
|
|
2181
|
+
type: "time"
|
|
2238
2182
|
},
|
|
2239
2183
|
{
|
|
2240
2184
|
name: "alighting_time",
|
|
2241
|
-
type: "
|
|
2242
|
-
},
|
|
2243
|
-
{
|
|
2244
|
-
name: "alighting_timestamp",
|
|
2245
|
-
type: "integer",
|
|
2246
|
-
index: true
|
|
2185
|
+
type: "time"
|
|
2247
2186
|
},
|
|
2248
2187
|
{
|
|
2249
2188
|
name: "rider_type",
|
|
@@ -2317,21 +2256,11 @@ var ridership = {
|
|
|
2317
2256
|
},
|
|
2318
2257
|
{
|
|
2319
2258
|
name: "ridership_start_time",
|
|
2320
|
-
type: "
|
|
2321
|
-
},
|
|
2322
|
-
{
|
|
2323
|
-
name: "ridership_start_timestamp",
|
|
2324
|
-
type: "integer",
|
|
2325
|
-
index: true
|
|
2259
|
+
type: "time"
|
|
2326
2260
|
},
|
|
2327
2261
|
{
|
|
2328
2262
|
name: "ridership_end_time",
|
|
2329
|
-
type: "
|
|
2330
|
-
},
|
|
2331
|
-
{
|
|
2332
|
-
name: "ridership_end_timestamp",
|
|
2333
|
-
type: "integer",
|
|
2334
|
-
index: true
|
|
2263
|
+
type: "time"
|
|
2335
2264
|
},
|
|
2336
2265
|
{
|
|
2337
2266
|
name: "service_id",
|
|
@@ -2923,24 +2852,14 @@ var deadheadTimes = {
|
|
|
2923
2852
|
},
|
|
2924
2853
|
{
|
|
2925
2854
|
name: "arrival_time",
|
|
2926
|
-
type: "
|
|
2855
|
+
type: "time",
|
|
2927
2856
|
required: true
|
|
2928
2857
|
},
|
|
2929
|
-
{
|
|
2930
|
-
name: "arrival_timestamp",
|
|
2931
|
-
type: "integer",
|
|
2932
|
-
index: true
|
|
2933
|
-
},
|
|
2934
2858
|
{
|
|
2935
2859
|
name: "departure_time",
|
|
2936
|
-
type: "
|
|
2860
|
+
type: "time",
|
|
2937
2861
|
required: true
|
|
2938
2862
|
},
|
|
2939
|
-
{
|
|
2940
|
-
name: "departure_timestamp",
|
|
2941
|
-
type: "integer",
|
|
2942
|
-
index: true
|
|
2943
|
-
},
|
|
2944
2863
|
{
|
|
2945
2864
|
name: "ops_location_id",
|
|
2946
2865
|
type: "text",
|
|
@@ -3285,21 +3204,6 @@ function formatCurrency(value, currency) {
|
|
|
3285
3204
|
return `${integerPart}${fractionPart !== "" ? `.${fractionPart}` : ""}`;
|
|
3286
3205
|
}
|
|
3287
3206
|
|
|
3288
|
-
// src/lib/import-gtfs.ts
|
|
3289
|
-
var TIME_COLUMN_NAMES = [
|
|
3290
|
-
"start_time",
|
|
3291
|
-
"end_time",
|
|
3292
|
-
"arrival_time",
|
|
3293
|
-
"departure_time",
|
|
3294
|
-
"prior_notice_last_time",
|
|
3295
|
-
"prior_notice_start_time",
|
|
3296
|
-
"start_pickup_drop_off_window"
|
|
3297
|
-
];
|
|
3298
|
-
var TIME_COLUMN_PAIRS = TIME_COLUMN_NAMES.map((name) => [
|
|
3299
|
-
name,
|
|
3300
|
-
name.endsWith("time") ? `${name}stamp` : `${name}_timestamp`
|
|
3301
|
-
]);
|
|
3302
|
-
|
|
3303
3207
|
// src/lib/export.ts
|
|
3304
3208
|
import path2 from "node:path";
|
|
3305
3209
|
import { writeFile } from "node:fs/promises";
|
|
@@ -3369,18 +3273,7 @@ var exportGtfs = async (initialConfig) => {
|
|
|
3369
3273
|
return;
|
|
3370
3274
|
}
|
|
3371
3275
|
if (model.filenameExtension === "txt") {
|
|
3372
|
-
const excludeColumns = [
|
|
3373
|
-
"arrival_timestamp",
|
|
3374
|
-
"departure_timestamp",
|
|
3375
|
-
"start_timestamp",
|
|
3376
|
-
"end_timestamp",
|
|
3377
|
-
"service_arrival_timestamp",
|
|
3378
|
-
"service_departure_timestamp",
|
|
3379
|
-
"boarding_timestamp",
|
|
3380
|
-
"alighting_timestamp",
|
|
3381
|
-
"ridership_start_timestamp",
|
|
3382
|
-
"ridership_end_timestamp"
|
|
3383
|
-
];
|
|
3276
|
+
const excludeColumns = [];
|
|
3384
3277
|
if (model.filenameBase === "routes") {
|
|
3385
3278
|
const routesWithAgencyId = db.prepare(
|
|
3386
3279
|
"SELECT agency_id FROM routes WHERE agency_id IS NOT NULL;"
|
|
@@ -3394,7 +3287,7 @@ var exportGtfs = async (initialConfig) => {
|
|
|
3394
3287
|
}
|
|
3395
3288
|
} else if (model.filenameBase === "fare_products") {
|
|
3396
3289
|
for (const line of lines) {
|
|
3397
|
-
line.
|
|
3290
|
+
line.amount = formatCurrency(line.amount, line.currency);
|
|
3398
3291
|
}
|
|
3399
3292
|
}
|
|
3400
3293
|
const columns = without(
|