gtfs 4.12.0 → 4.13.1
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 +27 -5
- package/dist/bin/gtfs-export.d.ts +1 -0
- package/dist/bin/gtfs-export.js +3645 -0
- package/dist/bin/gtfs-export.js.map +1 -0
- package/dist/bin/gtfs-import.d.ts +1 -0
- package/dist/bin/gtfs-import.js +4143 -0
- package/dist/bin/gtfs-import.js.map +1 -0
- package/dist/bin/gtfsrealtime-update.d.ts +1 -0
- package/dist/bin/gtfsrealtime-update.js +3800 -0
- package/dist/bin/gtfsrealtime-update.js.map +1 -0
- package/dist/index.d.ts +172 -0
- package/dist/index.js +5202 -0
- package/dist/index.js.map +1 -0
- package/package.json +26 -12
- package/.eslintrc.json +0 -28
- package/.github/workflows/nodejs.yml +0 -21
- package/.husky/pre-commit +0 -4
- package/@types/index.d.ts +0 -606
- package/@types/tests.ts +0 -31
- package/@types/tsconfig.json +0 -17
- package/CHANGELOG.md +0 -905
- package/bin/gtfs-export.js +0 -42
- package/bin/gtfs-import.js +0 -52
- package/bin/gtfsrealtime-update.js +0 -35
- package/config-sample-full.json +0 -20
- package/config-sample-rtupdates.json +0 -16
- package/config-sample.json +0 -8
- package/docs/images/node-gtfs-logo.svg +0 -18
- package/index.js +0 -1
- package/lib/advancedQuery.js +0 -36
- package/lib/db.js +0 -92
- package/lib/export.js +0 -141
- package/lib/file-utils.js +0 -103
- package/lib/geojson-utils.js +0 -138
- package/lib/gtfs/agencies.js +0 -32
- package/lib/gtfs/areas.js +0 -27
- package/lib/gtfs/attributions.js +0 -32
- package/lib/gtfs/booking-rules.js +0 -32
- package/lib/gtfs/calendar-dates.js +0 -32
- package/lib/gtfs/calendars.js +0 -32
- package/lib/gtfs/fare-attributes.js +0 -32
- package/lib/gtfs/fare-leg-rules.js +0 -32
- package/lib/gtfs/fare-media.js +0 -32
- package/lib/gtfs/fare-products.js +0 -32
- package/lib/gtfs/fare-rules.js +0 -32
- package/lib/gtfs/fare-transfer-rules.js +0 -32
- package/lib/gtfs/feed-info.js +0 -32
- package/lib/gtfs/frequencies.js +0 -32
- package/lib/gtfs/levels.js +0 -27
- package/lib/gtfs/location-group-stops.js +0 -32
- package/lib/gtfs/location-groups.js +0 -32
- package/lib/gtfs/locations.js +0 -32
- package/lib/gtfs/networks.js +0 -32
- package/lib/gtfs/pathways.js +0 -32
- package/lib/gtfs/route-networks.js +0 -32
- package/lib/gtfs/routes.js +0 -72
- package/lib/gtfs/shapes.js +0 -119
- package/lib/gtfs/stop-areas.js +0 -32
- package/lib/gtfs/stop-times.js +0 -32
- package/lib/gtfs/stops.js +0 -136
- package/lib/gtfs/timeframes.js +0 -32
- package/lib/gtfs/transfers.js +0 -32
- package/lib/gtfs/translations.js +0 -32
- package/lib/gtfs/trips.js +0 -27
- package/lib/gtfs-plus/calendar-attributes.js +0 -32
- package/lib/gtfs-plus/directions.js +0 -32
- package/lib/gtfs-plus/route-attributes.js +0 -32
- package/lib/gtfs-plus/stop-attributes.js +0 -32
- package/lib/gtfs-realtime/service-alerts.js +0 -34
- package/lib/gtfs-realtime/stop-time-updates.js +0 -32
- package/lib/gtfs-realtime/trip-updates.js +0 -32
- package/lib/gtfs-realtime/vehicle-positions.js +0 -32
- package/lib/gtfs-ride/board-alights.js +0 -32
- package/lib/gtfs-ride/ride-feed-infos.js +0 -32
- package/lib/gtfs-ride/rider-trips.js +0 -32
- package/lib/gtfs-ride/riderships.js +0 -32
- package/lib/gtfs-ride/trip-capacities.js +0 -32
- package/lib/gtfs.js +0 -261
- package/lib/import.js +0 -803
- package/lib/log-utils.js +0 -73
- package/lib/non-standard/timetable-notes-references.js +0 -32
- package/lib/non-standard/timetable-notes.js +0 -32
- package/lib/non-standard/timetable-pages.js +0 -32
- package/lib/non-standard/timetable-stop-order.js +0 -32
- package/lib/non-standard/timetables.js +0 -32
- package/lib/non-standard/trips-dated-vehicle-journey.js +0 -32
- package/lib/ods/deadhead-times.js +0 -32
- package/lib/ods/deadheads.js +0 -32
- package/lib/ods/ops-locations.js +0 -32
- package/lib/ods/run-events.js +0 -32
- package/lib/ods/runs-pieces.js +0 -32
- package/lib/utils.js +0 -178
- package/models/gtfs/agency.js +0 -49
- package/models/gtfs/areas.js +0 -19
- package/models/gtfs/attributions.js +0 -68
- package/models/gtfs/booking-rules.js +0 -92
- package/models/gtfs/calendar-dates.js +0 -34
- package/models/gtfs/calendar.js +0 -76
- package/models/gtfs/fare-attributes.js +0 -48
- package/models/gtfs/fare-leg-rules.js +0 -55
- package/models/gtfs/fare-media.js +0 -26
- package/models/gtfs/fare-products.js +0 -35
- package/models/gtfs/fare-rules.js +0 -34
- package/models/gtfs/fare-transfer-rules.js +0 -56
- package/models/gtfs/feed-info.js +0 -50
- package/models/gtfs/frequencies.js +0 -46
- package/models/gtfs/levels.js +0 -25
- package/models/gtfs/location-group-stops.js +0 -22
- package/models/gtfs/location-groups.js +0 -19
- package/models/gtfs/locations.js +0 -12
- package/models/gtfs/networks.js +0 -20
- package/models/gtfs/pathways.js +0 -74
- package/models/gtfs/route-networks.js +0 -21
- package/models/gtfs/routes.js +0 -79
- package/models/gtfs/shapes.js +0 -41
- package/models/gtfs/stop-areas.js +0 -20
- package/models/gtfs/stop-times.js +0 -120
- package/models/gtfs/stops.js +0 -85
- package/models/gtfs/timeframes.js +0 -29
- package/models/gtfs/transfers.js +0 -56
- package/models/gtfs/translations.js +0 -48
- package/models/gtfs/trips.js +0 -70
- package/models/gtfs-plus/calendar-attributes.js +0 -22
- package/models/gtfs-plus/directions.js +0 -29
- package/models/gtfs-plus/route-attributes.js +0 -34
- package/models/gtfs-plus/stop-attributes.js +0 -35
- package/models/gtfs-realtime/service-alert-targets.js +0 -37
- package/models/gtfs-realtime/service-alerts.js +0 -60
- package/models/gtfs-realtime/stop-time-updates.js +0 -85
- package/models/gtfs-realtime/trip-updates.js +0 -75
- package/models/gtfs-realtime/vehicle-positions.js +0 -135
- package/models/gtfs-ride/board-alight.js +0 -132
- package/models/gtfs-ride/ride-feed-info.js +0 -40
- package/models/gtfs-ride/rider-trip.js +0 -113
- package/models/gtfs-ride/ridership.js +0 -127
- package/models/gtfs-ride/trip-capacity.js +0 -51
- package/models/models.js +0 -120
- package/models/non-standard/timetable-notes-references.js +0 -50
- package/models/non-standard/timetable-notes.js +0 -24
- package/models/non-standard/timetable-pages.js +0 -23
- package/models/non-standard/timetable-stop-order.js +0 -32
- package/models/non-standard/timetables.js +0 -144
- package/models/non-standard/trips-dated-vehicle-journey.js +0 -34
- package/models/ods/deadhead-times.js +0 -65
- package/models/ods/deadheads.js +0 -60
- package/models/ods/ops-locations.js +0 -46
- package/models/ods/run-events.js +0 -70
- package/models/ods/runs-pieces.js +0 -59
- package/test/fixture/caltrain_20160406.zip +0 -0
- package/test/mocha/advanced-query.js +0 -74
- package/test/mocha/delete-db.js +0 -62
- package/test/mocha/export-gtfs.js +0 -147
- package/test/mocha/fare-transfer-rules.js +0 -32
- package/test/mocha/get-agencies.js +0 -90
- package/test/mocha/get-areas.js +0 -27
- package/test/mocha/get-attributions.js +0 -27
- package/test/mocha/get-board-alights.js +0 -28
- package/test/mocha/get-booking-rules.js +0 -28
- package/test/mocha/get-calendar-attributes.js +0 -33
- package/test/mocha/get-calendar-dates.js +0 -107
- package/test/mocha/get-calendars.js +0 -94
- package/test/mocha/get-directions.js +0 -28
- package/test/mocha/get-fare-attributes.js +0 -51
- package/test/mocha/get-fare-leg-rules.js +0 -27
- package/test/mocha/get-fare-media.js +0 -27
- package/test/mocha/get-fare-products.js +0 -27
- package/test/mocha/get-fare-rules.js +0 -50
- package/test/mocha/get-feed-info.js +0 -28
- package/test/mocha/get-frequencies.js +0 -28
- package/test/mocha/get-levels.js +0 -28
- package/test/mocha/get-location-group-stops.js +0 -33
- package/test/mocha/get-location-groups.js +0 -28
- package/test/mocha/get-locations.js +0 -69
- package/test/mocha/get-networks.js +0 -28
- package/test/mocha/get-pathways.js +0 -28
- package/test/mocha/get-ride-feed-infos.js +0 -24
- package/test/mocha/get-rider-trips.js +0 -28
- package/test/mocha/get-riderships.js +0 -28
- package/test/mocha/get-route-attributes.js +0 -33
- package/test/mocha/get-route-networks.js +0 -28
- package/test/mocha/get-routes.js +0 -143
- package/test/mocha/get-shapes-as-geojson.js +0 -92
- package/test/mocha/get-shapes.js +0 -240
- package/test/mocha/get-stop-attributes.js +0 -28
- package/test/mocha/get-stops-as-geojson.js +0 -87
- package/test/mocha/get-stops.js +0 -343
- package/test/mocha/get-stoptimes.js +0 -67
- package/test/mocha/get-timeframes.js +0 -28
- package/test/mocha/get-timetable-pages.js +0 -28
- package/test/mocha/get-timetable-stop-orders.js +0 -33
- package/test/mocha/get-timetables.js +0 -28
- package/test/mocha/get-transfers.js +0 -28
- package/test/mocha/get-translations.js +0 -28
- package/test/mocha/get-trip-capacities.js +0 -28
- package/test/mocha/get-trips.js +0 -53
- package/test/mocha/import-gtfs.js +0 -173
- package/test/mocha/open-db.js +0 -149
- package/test/mocha/raw-query.js +0 -34
- package/test/test-config.js +0 -12
package/README.md
CHANGED
|
@@ -94,6 +94,10 @@ try {
|
|
|
94
94
|
<td><img src="https://github.com/BlinkTagInc/gtfs-to-chart/raw/master/docs/images/gtfs-to-chart-logo.svg" alt="GTFS-to-Chart" width="200"></td>
|
|
95
95
|
<td><a href="https://github.com/blinktaginc/gtfs-to-chart">GTFS-to-chart</a> generates a stringline chart in D3 for all trips for a specific route using data from an agency's GTFS. It uses `node-gtfs` for downloading, importing and querying GTFS data.</td>
|
|
96
96
|
</tr>
|
|
97
|
+
<tr>
|
|
98
|
+
<td><img src="https://github.com/BlinkTagInc/gtfs-accessibility-validator/raw/main/docs/images/gtfs-accessibility-validator-logo.svg" alt="GTFS Accessibility Validator" width="200"></td>
|
|
99
|
+
<td><a href="https://github.com/blinktaginc/gtfs-accessibility-validator">GTFS Accessibility Validator</a> checks for accessiblity-realted fields and files and flags any issues. It uses `node-gtfs` for downloading, importing and querying GTFS data.</td>
|
|
100
|
+
</tr>
|
|
97
101
|
<tr>
|
|
98
102
|
<td><img src="https://github.com/BlinkTagInc/gtfs-tts/raw/main/docs/images/gtfs-tts-logo.svg" alt="GTFS-TTS" width="200"></td>
|
|
99
103
|
<td><a href="https://github.com/blinktaginc/gtfs-tts">GTFS-Text-to-Speech</a> app tests GTFS stop name pronunciation for text-to-speech. It uses `node-gtfs` for loading stop names from GTFS data.</td>
|
|
@@ -151,6 +155,7 @@ Copy `config-sample.json` to `config.json` and then add your projects configurat
|
|
|
151
155
|
| [`db`](#db) | database instance | An existing database instance to use instead of relying on node-gtfs to connect. Optional. |
|
|
152
156
|
| [`downloadTimeout`](#downloadtimeout) | integer | The number of milliseconds to wait before throwing an error when downloading GTFS. Optional. |
|
|
153
157
|
| [`exportPath`](#exportPath) | string | A path to a directory to put exported GTFS files. Optional, defaults to `gtfs-export/<agency_name>`. |
|
|
158
|
+
| [`gtfsRealtimeExpirationSeconds`](#gtfsrealtimeexpirationseconds) | integer | Amount of time in seconds to allow GTFS-Realtime data to be stored in database before allowing to be deleted. Optional, defaults to 0. |
|
|
154
159
|
| [`ignoreDuplicates`](#ignoreduplicates) | boolean | Whether or not to ignore unique constraints on ids when importing GTFS, such as `trip_id`, `calendar_id`. Optional, defaults to false. |
|
|
155
160
|
| [`ignoreErrors`](#ignoreerrors) | boolean | Whether or not to ignore errors during the import process. If true, when importing multiple agencies, failed agencies will be skipped. Optional, defaults to false. |
|
|
156
161
|
| [`sqlitePath`](#sqlitePath) | string | A path to an SQLite database. Optional, defaults to using an in-memory database. |
|
|
@@ -375,6 +380,27 @@ importGtfs({
|
|
|
375
380
|
}
|
|
376
381
|
```
|
|
377
382
|
|
|
383
|
+
### gtfsRealtimeExpirationSeconds
|
|
384
|
+
|
|
385
|
+
{Integer} Amount of time in seconds to allow GTFS-Realtime data to be stored in database before allowing to be deleted. Defaults to 0 (old GTFS-Realtime is deleted immediately when new data arrives).
|
|
386
|
+
|
|
387
|
+
```json
|
|
388
|
+
{
|
|
389
|
+
"agencies": [
|
|
390
|
+
{
|
|
391
|
+
"url": "https://agency.com/gtfs.zip",
|
|
392
|
+
"realtimeUrls": [
|
|
393
|
+
"https://agency.com/gtfs-rt/alerts",
|
|
394
|
+
"https://agency.com/gtfs-rt/tripupdates",
|
|
395
|
+
"https://agency.com/gtfs-rt/vehiclepositions"
|
|
396
|
+
]
|
|
397
|
+
}
|
|
398
|
+
],
|
|
399
|
+
"gtfsRealtimeExpirationSeconds": false
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
|
|
378
404
|
### ignoreDuplicates
|
|
379
405
|
|
|
380
406
|
{Boolean} If you don't want node-GTFS to throw an error when it encounters a duplicate id on GTFS import. If `true`, it will skip importing duplicate records where unique constraints are violated, such as`trip_id`, `stop_id`, `calendar_id`. Useful if importing GTFS from multiple sources into one SQlite database that share routes or stops. Defaults to `false`.
|
|
@@ -1760,8 +1786,4 @@ To run tests:
|
|
|
1760
1786
|
|
|
1761
1787
|
To run a specific test:
|
|
1762
1788
|
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
### Linting
|
|
1766
|
-
|
|
1767
|
-
npm run lint
|
|
1789
|
+
npm test -- get-stoptimes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|