From 34617144cefda5b6c917fdadc626a79ee552bccb Mon Sep 17 00:00:00 2001 From: Brendan Nee Date: Wed, 17 Jan 2024 22:27:17 -0800 Subject: [PATCH] Updates to GTFS-Realtime functions --- @types/index.d.ts | 80 +++++++++--------- CHANGELOG.md | 9 ++ README.md | 8 +- ...-times-updates.js => stop-time-updates.js} | 10 +-- lib/gtfs.js | 6 +- lib/import.js | 83 ++++++++++++------- models/gtfs-realtime/service-alert-targets.js | 2 +- models/gtfs-realtime/service-alerts.js | 2 +- ...-times-updates.js => stop-time-updates.js} | 22 ++++- models/gtfs-realtime/trip-updates.js | 27 +++++- models/gtfs-realtime/vehicle-positions.js | 2 +- models/models.js | 4 +- 12 files changed, 166 insertions(+), 89 deletions(-) rename lib/gtfs-realtime/{stop-times-updates.js => stop-time-updates.js} (80%) rename models/gtfs-realtime/{stop-times-updates.js => stop-time-updates.js} (71%) diff --git a/@types/index.d.ts b/@types/index.d.ts index 1c713b0d..199de1ca 100644 --- a/@types/index.d.ts +++ b/@types/index.d.ts @@ -152,7 +152,7 @@ export function getAgencies( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -162,7 +162,7 @@ export function getAreas( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -172,7 +172,7 @@ export function getAttributions( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -182,7 +182,7 @@ export function getRoutes( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -192,7 +192,7 @@ export function getStops( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -201,7 +201,7 @@ export function getStops( */ export function getStopsAsGeoJSON( query?: SqlWhere, - options?: QueryOptions + options?: QueryOptions, ): Promise>; /** @@ -211,7 +211,7 @@ export function getStoptimes( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -221,7 +221,7 @@ export function getTrips( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -231,7 +231,7 @@ export function getShapes( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -240,7 +240,7 @@ export function getShapes( */ export function getShapesAsGeoJSON( query?: SqlWhere, - options?: QueryOptions + options?: QueryOptions, ): FeatureCollection; /** @@ -250,7 +250,7 @@ export function getCalendars( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -260,7 +260,7 @@ export function getCalendarDates( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -270,7 +270,7 @@ export function getFareAttributes( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -280,7 +280,7 @@ export function getFareLegRules( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -290,7 +290,7 @@ export function getFareProducts( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -300,7 +300,7 @@ export function getFareRules( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -310,7 +310,7 @@ export function getFareTransferRules( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -320,7 +320,7 @@ export function getFeedInfo( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -330,7 +330,7 @@ export function getFrequencies( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -340,7 +340,7 @@ export function getLevels( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -350,7 +350,7 @@ export function getPathways( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -360,7 +360,7 @@ export function getTransfers( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -370,7 +370,7 @@ export function getTranslations( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -380,7 +380,7 @@ export function getStopAreas( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -391,7 +391,7 @@ export function getCalendarAttributes( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -402,7 +402,7 @@ export function getDirections( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -413,7 +413,7 @@ export function getRouteAttributes( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -424,7 +424,7 @@ export function getStopAttributes( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -435,7 +435,7 @@ export function getTimetables( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -446,7 +446,7 @@ export function getTimetableStopOrders( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -457,7 +457,7 @@ export function getTimetablePages( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -468,7 +468,7 @@ export function getTimetableNotes( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -479,7 +479,7 @@ export function getTimetableNotesReferences( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -490,7 +490,7 @@ export function getTripsDatedVehicleJourneys( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -501,7 +501,7 @@ export function getServiceAlerts( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -512,18 +512,18 @@ export function getTripUpdates( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** * Returns an array of GTFS Realtime stop time updates that match query parameters. * This only works if you configure GTFS Realtime import in node-gtfs. */ -export function getStopTimesUpdates( +export function getStopTimeUpdates( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -534,7 +534,7 @@ export function getVehiclePositions( query?: SqlWhere, fields?: SqlSelect, sortBy?: SqlOrderBy, - options?: QueryOptions + options?: QueryOptions, ): SqlResults; /** @@ -542,5 +542,5 @@ export function getVehiclePositions( */ export function advancedQuery( table?: SqlTableName, - advancedQueryOptions?: AdvancedQueryOptions + advancedQueryOptions?: AdvancedQueryOptions, ): SqlResults; diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f05517a..2fe4afbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Renamed `getStopTimesUpdates` to `getStopTimeUpdates`. + +### Added +- Added `schedule_relationship`, `trip_start_time`, `direction_id` and `route_id` fields to stop_time_updates and trip_updates tables. + ## [4.5.1] - 2023-11-09 ### Updated diff --git a/README.md b/README.md index 245843c2..e0ae1bfd 100644 --- a/README.md +++ b/README.md @@ -1189,15 +1189,15 @@ import { getTripUpdates } from 'gtfs'; const tripUpdates = getTripUpdates(); ``` -#### getStopTimesUpdates(query, fields, sortBy, options) +#### getStopTimeUpdates(query, fields, sortBy, options) Returns an array of GTFS Realtime stop time updates that match query parameters. [Details on Stop Time Updates](https://gtfs.org/realtime/feed-entities/trip-updates/#stoptimeupdate) ```js -import { getStopTimesUpdates } from 'gtfs'; +import { getStopTimeUpdates } from 'gtfs'; -// Get all stop times updates -const stopTimesUpdates = getStopTimesUpdates(); +// Get all stop time updates +const stopTimeUpdates = getStopTimeUpdates(); ``` #### getVehiclePositions(query, fields, sortBy, options) diff --git a/lib/gtfs-realtime/stop-times-updates.js b/lib/gtfs-realtime/stop-time-updates.js similarity index 80% rename from lib/gtfs-realtime/stop-times-updates.js rename to lib/gtfs-realtime/stop-time-updates.js index 6d021e62..415c9837 100644 --- a/lib/gtfs-realtime/stop-times-updates.js +++ b/lib/gtfs-realtime/stop-time-updates.js @@ -7,16 +7,16 @@ import { formatSelectClause, formatWhereClauses, } from '../utils.js'; -import stopTimeUpdates from '../../models/gtfs-realtime/stop-times-updates.js'; +import stopTimeUpdates from '../../models/gtfs-realtime/stop-time-updates.js'; /* - * Returns an array of all stop times updates that match the query parameters. + * Returns an array of all stop time updates that match the query parameters. */ -export function getStopTimesUpdates( +export function getStopTimeUpdates( query = {}, fields = [], orderBy = [], - options = {} + options = {}, ) { const db = options.db ?? openDb(); const tableName = sqlString.escapeId(stopTimeUpdates.filenameBase); @@ -26,7 +26,7 @@ export function getStopTimesUpdates( return db .prepare( - `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};` + `${selectClause} FROM ${tableName} ${whereClause} ${orderByClause};`, ) .all(); } diff --git a/lib/gtfs.js b/lib/gtfs.js index 04e2f5b7..ae828412 100644 --- a/lib/gtfs.js +++ b/lib/gtfs.js @@ -50,7 +50,7 @@ import { getRiderships } from './gtfs-ride/riderships.js'; import { getTripCapacities } from './gtfs-ride/trip-capacities.js'; // GTFS-Realtime Filenames -import { getStopTimesUpdates } from './gtfs-realtime/stop-times-updates.js'; +import { getStopTimeUpdates } from './gtfs-realtime/stop-time-updates.js'; import { getTripUpdates } from './gtfs-realtime/trip-updates.js'; import { getVehiclePositions } from './gtfs-realtime/vehicle-positions.js'; import { getServiceAlerts } from './gtfs-realtime/service-alerts.js'; @@ -191,8 +191,8 @@ export { _getTripCapacities as getTripCapacities }; const _updateGtfsRealtime = updateGtfsRealtime; export { _updateGtfsRealtime as updateGtfsRealtime }; -const _getStopTimesUpdates = getStopTimesUpdates; -export { _getStopTimesUpdates as getStopTimesUpdates }; +const _getStopTimeUpdates = getStopTimeUpdates; +export { _getStopTimeUpdates as getStopTimeUpdates }; const _getTripUpdates = getTripUpdates; export { _getTripUpdates as getTripUpdates }; diff --git a/lib/import.js b/lib/import.js index 8028bbae..675e5f60 100644 --- a/lib/import.js +++ b/lib/import.js @@ -9,7 +9,7 @@ import stripBomStream from 'strip-bom-stream'; import { dir } from 'tmp-promise'; import untildify from 'untildify'; import mapSeries from 'promise-map-series'; -import gtfsrt from 'gtfs-realtime-bindings'; +import GtfsRealtimeBindings from 'gtfs-realtime-bindings'; import sqlString from 'sqlstring-sqlite'; import models from '../models/models.js'; @@ -59,7 +59,18 @@ const downloadGtfsRealtimeData = async (url, headers) => { } const buffer = await response.arrayBuffer(); - return gtfsrt.transit_realtime.FeedMessage.decode(Buffer.from(buffer)); + const message = GtfsRealtimeBindings.transit_realtime.FeedMessage.decode( + new Uint8Array(buffer), + ); + return GtfsRealtimeBindings.transit_realtime.FeedMessage.toObject(message, { + enums: String, + longs: String, + bytes: String, + defaults: true, + arrays: true, + objects: true, + oneofs: true, + }); }; function getDescendantProp(obj, desc, defaultvalue) { @@ -69,11 +80,19 @@ function getDescendantProp(obj, desc, defaultvalue) { const nextKey = arr.shift(); if (nextKey.includes('[')) { const arrayKey = nextKey.match(/(\w*)\[(\d+)\]/); - if (!obj[arrayKey[1]]) return defaultvalue; - if (!obj[arrayKey[1]][arrayKey[2]]) return defaultvalue; + if (obj[arrayKey[1]] === undefined) { + return defaultvalue; + } + + if (obj[arrayKey[1]][arrayKey[2]] === undefined) { + return defaultvalue; + } + obj = obj[arrayKey[1]][arrayKey[2]]; } else { - if (!obj[nextKey]) return defaultvalue; + if (obj[nextKey] === undefined) { + return defaultvalue; + } obj = obj[nextKey]; } } @@ -87,11 +106,11 @@ const markRealtimeDataStale = (config, log) => { const db = openDb(config); log(`Marking GTFS-Realtime data as stale..`); - db.prepare(`UPDATE vehicle_positions SET isUpdated=0`).run(); - db.prepare(`UPDATE trip_updates SET isUpdated=0`).run(); - db.prepare(`UPDATE stop_times_updates SET isUpdated=0`).run(); - db.prepare(`UPDATE service_alerts SET isUpdated=0`).run(); - db.prepare(`UPDATE service_alert_targets SET isUpdated=0`).run(); + db.prepare(`UPDATE vehicle_positions SET is_updated=0`).run(); + db.prepare(`UPDATE trip_updates SET is_updated=0`).run(); + db.prepare(`UPDATE stop_time_updates SET is_updated=0`).run(); + db.prepare(`UPDATE service_alerts SET is_updated=0`).run(); + db.prepare(`UPDATE service_alert_targets SET is_updated=0`).run(); log(`Marked GTFS-Realtime data as stale\r`, true); }; @@ -99,11 +118,11 @@ const cleanStaleRealtimeData = (config, log) => { const db = openDb(config); log(`Cleaning stale GTFS-RT data..`); - db.prepare(`DELETE FROM vehicle_positions WHERE isUpdated=0`).run(); - db.prepare(`DELETE FROM trip_updates WHERE isUpdated=0`).run(); - db.prepare(`DELETE FROM stop_times_updates WHERE isUpdated=0`).run(); - db.prepare(`DELETE FROM service_alerts WHERE isUpdated=0`).run(); - db.prepare(`DELETE FROM service_alert_targets WHERE isUpdated=0`).run(); + db.prepare(`DELETE FROM vehicle_positions WHERE is_updated=0`).run(); + db.prepare(`DELETE FROM trip_updates WHERE is_updated=0`).run(); + db.prepare(`DELETE FROM stop_time_updates WHERE is_updated=0`).run(); + db.prepare(`DELETE FROM service_alerts WHERE is_updated=0`).run(); + db.prepare(`DELETE FROM service_alert_targets WHERE is_updated=0`).run(); log(`Cleaned stale GTFS-Realtime data\r`, true); }; @@ -115,8 +134,8 @@ const updateRealtimeData = async (task) => { (x) => x.filenameBase === 'vehicle_positions', ), trip_updates: models.find((x) => x.filenameBase === 'trip_updates'), - stop_times_updates: models.find( - (x) => x.filenameBase === 'stop_times_updates', + stop_time_updates: models.find( + (x) => x.filenameBase === 'stop_time_updates', ), service_alerts: models.find((x) => x.filenameBase === 'service_alerts'), service_alert_targets: models.find( @@ -131,7 +150,7 @@ const updateRealtimeData = async (task) => { trip_updates: model.trip_updates.schema .map((column) => column.name) .join(', '), - stop_times_updates: model.stop_times_updates.schema + stop_time_updates: model.stop_time_updates.schema .map((column) => column.name) .join(', '), service_alerts: model.service_alerts.schema @@ -149,14 +168,20 @@ const updateRealtimeData = async (task) => { for (const realtimeUrl of task.realtime_urls) { task.log(`Downloading GTFS-Realtime from ${realtimeUrl}`); // eslint-disable-next-line no-await-in-loop - const tripUpdateData = await downloadGtfsRealtimeData( + const gtfsRealtimeData = await downloadGtfsRealtimeData( realtimeUrl, task.realtime_headers, ); + task.log(`Download successful`); + if (!gtfsRealtimeData.entity) { + continue; + } + let totalLineCount = 0; - for (const entity of tripUpdateData.entity) { + + for (const entity of gtfsRealtimeData.entity) { // Determine the type of GTFS-Realtime let gtfsRealtimeType = null; if (entity.vehicle) { @@ -194,23 +219,23 @@ const updateRealtimeData = async (task) => { // Special processing for tripUpdates if (entity.tripUpdate) { - const stopUpdateArray = []; - for (const stopUpdate of entity.tripUpdate.stopTimeUpdate) { - stopUpdate.parent = entity; - const subValues = model.stop_times_updates.schema.map((column) => + const stopTimeUpdateArray = []; + for (const stopTimeUpdate of entity.tripUpdate.stopTimeUpdate) { + stopTimeUpdate.parent = entity; + const subValues = model.stop_time_updates.schema.map((column) => sqlString.escape( - getDescendantProp(stopUpdate, column.source, column.default), + getDescendantProp(stopTimeUpdate, column.source, column.default), ), ); - stopUpdateArray.push(`(${subValues.join(', ')})`); + stopTimeUpdateArray.push(`(${subValues.join(', ')})`); totalLineCount++; } try { db.prepare( - `REPLACE INTO ${model.stop_times_updates.filenameBase} (${ - fields.stop_times_updates - }) VALUES ${stopUpdateArray.join(', ')}`, + `REPLACE INTO ${model.stop_time_updates.filenameBase} (${ + fields.stop_time_updates + }) VALUES ${stopTimeUpdateArray.join(', ')}`, ).run(); } catch (error) { task.warn('Import error: ' + error.message); diff --git a/models/gtfs-realtime/service-alert-targets.js b/models/gtfs-realtime/service-alert-targets.js index ead4bf11..29254cd3 100644 --- a/models/gtfs-realtime/service-alert-targets.js +++ b/models/gtfs-realtime/service-alert-targets.js @@ -24,7 +24,7 @@ const model = { default: null, }, { - name: 'isUpdated', + name: 'is_updated', type: 'integer', required: true, min: 0, diff --git a/models/gtfs-realtime/service-alerts.js b/models/gtfs-realtime/service-alerts.js index 49537f01..2ed9b112 100644 --- a/models/gtfs-realtime/service-alerts.js +++ b/models/gtfs-realtime/service-alerts.js @@ -47,7 +47,7 @@ const model = { default: '', }, { - name: 'isUpdated', + name: 'is_updated', type: 'integer', required: true, min: 0, diff --git a/models/gtfs-realtime/stop-times-updates.js b/models/gtfs-realtime/stop-time-updates.js similarity index 71% rename from models/gtfs-realtime/stop-times-updates.js rename to models/gtfs-realtime/stop-time-updates.js index 04972703..0bb7d351 100644 --- a/models/gtfs-realtime/stop-times-updates.js +++ b/models/gtfs-realtime/stop-time-updates.js @@ -1,5 +1,5 @@ const model = { - filenameBase: 'stop_times_updates', + filenameBase: 'stop_time_updates', extension: 'gtfs-realtime', schema: [ { @@ -9,6 +9,18 @@ const model = { source: 'parent.tripUpdate.trip.tripId', default: null, }, + { + name: 'trip_start_time', + type: 'varchar(255)', + source: 'parent.tripUpdate.trip.startTime', + default: null, + }, + { + name: 'direction_id', + type: 'integer', + source: 'parent.tripUpdate.trip.directionId', + default: null, + }, { name: 'route_id', type: 'varchar(255)', @@ -54,7 +66,13 @@ const model = { default: null, }, { - name: 'isUpdated', + name: 'schedule_relationship', + type: 'varchar(255)', + source: 'scheduleRelationship', + default: null, + }, + { + name: 'is_updated', type: 'integer', required: true, min: 0, diff --git a/models/gtfs-realtime/trip-updates.js b/models/gtfs-realtime/trip-updates.js index f9a20f17..6b9c5616 100644 --- a/models/gtfs-realtime/trip-updates.js +++ b/models/gtfs-realtime/trip-updates.js @@ -24,6 +24,25 @@ const model = { source: 'tripUpdate.trip.tripId', default: null, }, + { + name: 'trip_start_time', + type: 'varchar(255)', + source: 'tripUpdate.trip.startTime', + default: null, + }, + { + name: 'direction_id', + type: 'integer', + source: 'tripUpdate.trip.directionId', + default: null, + }, + { + name: 'route_id', + type: 'varchar(255)', + index: true, + source: 'tripUpdate.trip.routeId', + default: null, + }, { name: 'start_date', type: 'varchar(255)', @@ -37,7 +56,13 @@ const model = { default: null, }, { - name: 'isUpdated', + name: 'schedule_relationship', + type: 'varchar(255)', + source: 'tripUpdate.trip.scheduleRelationship', + default: null, + }, + { + name: 'is_updated', type: 'integer', required: true, min: 0, diff --git a/models/gtfs-realtime/vehicle-positions.js b/models/gtfs-realtime/vehicle-positions.js index 9ef5ad42..649bd5fc 100644 --- a/models/gtfs-realtime/vehicle-positions.js +++ b/models/gtfs-realtime/vehicle-positions.js @@ -60,7 +60,7 @@ const model = { default: null, }, { - name: 'isUpdated', + name: 'is_updated', type: 'integer', required: true, min: 0, diff --git a/models/models.js b/models/models.js index 514b1eb1..38606c8e 100644 --- a/models/models.js +++ b/models/models.js @@ -40,7 +40,7 @@ import tripCapacity from '../models/gtfs-ride/trip-capacity.js'; import rideFeedInfo from './gtfs-ride/ride-feed-info.js'; import tripUpdates from './gtfs-realtime/trip-updates.js'; -import stopTimesUpdates from './gtfs-realtime/stop-times-updates.js'; +import stopTimeUpdates from './gtfs-realtime/stop-time-updates.js'; import vehiclePositions from './gtfs-realtime/vehicle-positions.js'; import serviceAlerts from './gtfs-realtime/service-alerts.js'; import serviceAlertTargets from './gtfs-realtime/service-alert-targets.js'; @@ -90,7 +90,7 @@ const models = [ ridership, tripCapacity, tripUpdates, - stopTimesUpdates, + stopTimeUpdates, vehiclePositions, serviceAlerts, serviceAlertTargets,