gtfs 4.14.1 → 4.14.2
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 +2 -2
- package/dist/bin/gtfs-import.js.map +1 -1
- package/dist/bin/gtfsrealtime-update.js +139 -2
- package/dist/bin/gtfsrealtime-update.js.map +1 -1
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -3292,18 +3292,20 @@ function shapesToGeoJSONFeature(shapes2, properties = {}) {
|
|
|
3292
3292
|
);
|
|
3293
3293
|
}
|
|
3294
3294
|
function stopsToGeoJSONFeatureCollection(stops2) {
|
|
3295
|
-
const features = compact(
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3295
|
+
const features = compact(
|
|
3296
|
+
stops2.map((stop) => {
|
|
3297
|
+
if (!stop.stop_lon || !stop.stop_lat) {
|
|
3298
|
+
return;
|
|
3299
|
+
}
|
|
3300
|
+
return feature(
|
|
3301
|
+
{
|
|
3302
|
+
type: "Point",
|
|
3303
|
+
coordinates: [stop.stop_lon, stop.stop_lat]
|
|
3304
|
+
},
|
|
3305
|
+
formatProperties(omit2(stop, ["stop_lat", "stop_lon"]))
|
|
3306
|
+
);
|
|
3307
|
+
})
|
|
3308
|
+
);
|
|
3307
3309
|
return featureCollection(features);
|
|
3308
3310
|
}
|
|
3309
3311
|
|
|
@@ -3680,12 +3682,12 @@ var updateRealtimeData = async (task) => {
|
|
|
3680
3682
|
task.log(`Download successful`);
|
|
3681
3683
|
let totalLineCount = 0;
|
|
3682
3684
|
for (const entity of gtfsRealtimeData.entity) {
|
|
3683
|
-
const fieldValues =
|
|
3685
|
+
const fieldValues = vehiclePositions.schema.map(
|
|
3684
3686
|
(column) => prepareRealtimeValue(entity, column, task)
|
|
3685
3687
|
);
|
|
3686
3688
|
try {
|
|
3687
3689
|
db.prepare(
|
|
3688
|
-
`REPLACE INTO ${
|
|
3690
|
+
`REPLACE INTO ${vehiclePositions.filenameBase} (${vehiclePositions.schema.map((column) => column.name).join(", ")}) VALUES (${fieldValues.join(", ")})`
|
|
3689
3691
|
).run();
|
|
3690
3692
|
} catch (error) {
|
|
3691
3693
|
task.logWarning("Import error: " + error.message);
|