gtfs 4.14.1 → 4.14.3
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/dist/bin/gtfs-export.js.map +1 -1
- package/dist/bin/gtfs-import.js +23 -23
- package/dist/bin/gtfs-import.js.map +1 -1
- package/dist/bin/gtfsrealtime-update.js +160 -15
- package/dist/bin/gtfsrealtime-update.js.map +1 -1
- package/dist/index.js +58 -48
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/dist/bin/gtfs-import.js
CHANGED
|
@@ -3526,12 +3526,12 @@ var updateRealtimeData = async (task) => {
|
|
|
3526
3526
|
task.log(`Download successful`);
|
|
3527
3527
|
let totalLineCount = 0;
|
|
3528
3528
|
for (const entity of gtfsRealtimeData.entity) {
|
|
3529
|
-
const fieldValues =
|
|
3529
|
+
const fieldValues = vehiclePositions.schema.map(
|
|
3530
3530
|
(column) => prepareRealtimeValue(entity, column, task)
|
|
3531
3531
|
);
|
|
3532
3532
|
try {
|
|
3533
3533
|
db.prepare(
|
|
3534
|
-
`REPLACE INTO ${
|
|
3534
|
+
`REPLACE INTO ${vehiclePositions.filenameBase} (${vehiclePositions.schema.map((column) => column.name).join(", ")}) VALUES (${fieldValues.join(", ")})`
|
|
3535
3535
|
).run();
|
|
3536
3536
|
} catch (error) {
|
|
3537
3537
|
task.logWarning("Import error: " + error.message);
|
|
@@ -3846,28 +3846,28 @@ async function importGtfs(initialConfig) {
|
|
|
3846
3846
|
await mapSeries(
|
|
3847
3847
|
config.agencies,
|
|
3848
3848
|
async (agency2) => {
|
|
3849
|
-
const tempPath = temporaryDirectory();
|
|
3850
|
-
const task = {
|
|
3851
|
-
exclude: agency2.exclude,
|
|
3852
|
-
url: agency2.url,
|
|
3853
|
-
headers: agency2.headers,
|
|
3854
|
-
realtimeAlerts: agency2.realtimeAlerts,
|
|
3855
|
-
realtimeTripUpdates: agency2.realtimeTripUpdates,
|
|
3856
|
-
realtimeVehiclePositions: agency2.realtimeVehiclePositions,
|
|
3857
|
-
downloadDir: tempPath,
|
|
3858
|
-
downloadTimeout: config.downloadTimeout,
|
|
3859
|
-
gtfsRealtimeExpirationSeconds: config.gtfsRealtimeExpirationSeconds,
|
|
3860
|
-
path: agency2.path,
|
|
3861
|
-
csvOptions: config.csvOptions || {},
|
|
3862
|
-
ignoreDuplicates: config.ignoreDuplicates,
|
|
3863
|
-
sqlitePath: config.sqlitePath,
|
|
3864
|
-
prefix: agency2.prefix,
|
|
3865
|
-
currentTimestamp: Math.floor(Date.now() / 1e3),
|
|
3866
|
-
log: log2,
|
|
3867
|
-
logWarning: logWarning2,
|
|
3868
|
-
logError: logError2
|
|
3869
|
-
};
|
|
3870
3849
|
try {
|
|
3850
|
+
const tempPath = temporaryDirectory();
|
|
3851
|
+
const task = {
|
|
3852
|
+
exclude: agency2.exclude,
|
|
3853
|
+
url: agency2.url,
|
|
3854
|
+
headers: agency2.headers,
|
|
3855
|
+
realtimeAlerts: agency2.realtimeAlerts,
|
|
3856
|
+
realtimeTripUpdates: agency2.realtimeTripUpdates,
|
|
3857
|
+
realtimeVehiclePositions: agency2.realtimeVehiclePositions,
|
|
3858
|
+
downloadDir: tempPath,
|
|
3859
|
+
downloadTimeout: config.downloadTimeout,
|
|
3860
|
+
gtfsRealtimeExpirationSeconds: config.gtfsRealtimeExpirationSeconds,
|
|
3861
|
+
path: agency2.path,
|
|
3862
|
+
csvOptions: config.csvOptions || {},
|
|
3863
|
+
ignoreDuplicates: config.ignoreDuplicates,
|
|
3864
|
+
sqlitePath: config.sqlitePath,
|
|
3865
|
+
prefix: agency2.prefix,
|
|
3866
|
+
currentTimestamp: Math.floor(Date.now() / 1e3),
|
|
3867
|
+
log: log2,
|
|
3868
|
+
logWarning: logWarning2,
|
|
3869
|
+
logError: logError2
|
|
3870
|
+
};
|
|
3871
3871
|
if (task.url) {
|
|
3872
3872
|
await downloadFiles(task);
|
|
3873
3873
|
}
|