All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Updated schema for service_alerts
- Dependency Updates
- Add support for JSON column type
- Support for arrival/departure time after midnight
- Updated GTFS-Realtime alerts fields
- Dependency Updates
- Dependency Updates
- Updates to time columns and timestamp columns
- Better GTFS export for currency
- GTFS export currency with correct number of decimal places
- Types for gtfs-to-html files
- Added primary key info for attributions.txt, fare_rules.txt, location_group_stops.txt, stop_areas.txt and timeframes.txt
- Better column checks on imports
- Don't exclude 'id' column from export
- Default logging verbose = true
- Improve typescript support for results of each query method
- Dependency Updates
- Better documentation for util functions
- Don't add prefixes to columns with null values
- Dependency Updates
- Improved logging functions
- Dependency Updates
- Added new method getServiceIdsByDate
- Added support for
date
,start_time
andend_time
in getStoptimes method
- Export types for each GTFS file
- Add elapsed time to output
- Optimze formatGtfsLine function
- Batch import into chunks
- Faster GTFS Import (thanks to Mael)
- Avoid array creation and string interpolation at each formatLine run
- Add a new build-watch script
- Memoize the calculate seconds from midnight and date functions
- Create indexes after importing all the GTFS files
- Avoid creating a new db connection for each importLines batch
- Use sqlite's transaction method rather than batching prepare().run()
- Fix getStops with bounding box test : order is not important
- Move gtfs-realtime functions to new file
- Dependency updates
- Dependency Updates
- Use
ignoreErrors
config for GTFS-Realtime fetching - Dependency Updates
- Better error handling for
gtfsrealtime-update
- Fix for GTFS-Realtime vehicle positions import
- Build before release-it
- Update to fare_transfer_rules.txt model
- Added types for all GTFS files
- Dependency Updates
- Changed config structure for GTFS-Realtime urls
- Dependency Updates
- Correction to trips_dated_vehicle_journey
- Changed model exports
- getShapesAsGeoJSON returns MultiLineString
- Omit undefined properties from geojson
- Better geojson tests
- Dependency Updates
- Better date import
- Dependency Updates
- Types for
openDb
function
- Convert to Typescript
- Move tests to Jest from Mocha
- Dependency Updates
- Make attribution_id optional
- Support for
service_id
ingetRoutes
- Use tempy for temporary directory creation
- Better tests for locations.geojson
- Handle unknown filename extensions in models
- Support for locations.geojson
- Update sqlite type for all models
- Dependency updates
- Don't throw error on GTFS-Realtime import HTTP error
- Remove recursive-copy module
- Dependency updates
- Support for GTFS Flex
- Support for booking_rules.txt
- Support for location_groups.txt
- Support for location_group_stops.txt
- Add
rule_priority
field tofare_leg_rules.txt
- Dependency updates
- Improved error messages
- Don't use pretty-error globally
- Dependency updates
- Additional GTFS-RT vehiclePosition fields
- deleteDb method
- Dependency updates
- Better error message for
gtfsrealtime-update
command - Support additional fields for vehiclePosition GTFS-Realtime data
- Dependency updates
- Dependency updates
- Support for fare_media.txt
- Support for networks.txt
- Support for route_networks.txt
- Support for timeframes.txt
- Close DB if not :memory: from CLI after import
ignoreErrors
config optiondownloadTimeout
config optiondb
config option
- Show info about ignoreDuplicates option when primary key constraint issue happens
- Dependency updates
- Support null arrival and departure in StopTimeUpdate
- Added
bounding_box_side_m
option togetStops
andgetStopsAsGeoJSON
to find all stops within a bounding box.
- Dependency updates
- Renamed
getStopTimesUpdates
togetStopTimeUpdates
.
- Added
schedule_relationship
,trip_start_time
,direction_id
androute_id
fields to stop_time_updates and trip_updates tables.
- Dependency updates
- Dependency updates
- Use path to types file instead of directory in package.json
- Exclude agency_id from export if empty
- Increase
maxInsertVariables
to 32,000 - Dependency updates
- Dependency updates
- Added index to stoptimes table for stop_id field
- Updated node.js versions for tests
- Use lint-staged instead of pretty-quick
- Dependency updates
- Pad leading zeros of timestamp columns
- Dependency updates
- node-csv
relax_quotes
config
- Ignore system directories within zip file
- Dependency updates
- Updated Readme to add closeDb documentation
- Use node-stream-zip instead of unzipper
- Support for prefixes when importing multiple GTFS files
- Add route_attributes to getShapesAsGeoJSON() function as geojson properties
- Add stop_attributes to getStopsAsGeoJSON() function as geojson properties
- Support for multi-column primary keys
- Support for GTFS+ Files
- Dependency updates
- Support for Operational Data Standard (ODS) Files
- Dependency updates
- Updates to sqlite journal mode
- Dependency updates
- In getStopsAsGeoJSON only return stops that are part of a route.
- Dependency updates
- Update types info
- Improved readme
- Improved queries
- Use better-sqlite3 library
- Make all query methods synchronous
- Remove
runRawQuery
(use Raw SQLite query instead) - Remove
execRawQuery
(use Raw SQLite query instead) - Remove
getDb
(useopenDb
instead)
- Dependency updates
- Add Node 18 tests
- Make transfer_type not required in transfers.txt
- Dependency updates
- Add ignoreDuplicates config option
- Support for querying null values as part of an array
- GTFS Fares v2 and new transfers.txt fields
- Dependency updates
- Better examples in readme
- Dependency updates
- Use yoctocolors instead of chalk
- Dependency updates
- Support untildify in sqlitePath config variable
- Dependency updates
- Documentation updates
- Added default:, and source: keywords in the models to describe a default value and a source to transform from for GTFS-Realtime
- Filtering all models belonging to GTFS-Realtime from import (but not export) in GTFS
- Added trips-dates-vehicle-journey.txt model
- GTFS-Realtime Support for VehiclePositions, TripUpdates and ServiceAlerts
- gtfsrealtime-update script - does selective refresh of only GTFS-Realtime data without deleting the database
- updateGtfsRealtime() method - does selective refresh of only GTFS-Realtime data without deleting the database
- getServiceAlerts(..), getStopTimesUpdates(..), getTripUpdates(..), and getVehicleLocations(..) added methods
- advancedQuery, runRawQuery and execRawQuery methods to perform direct database queries
- Add support for querying by shape_id
- Switched back to sqlite3 module
- Dependency Updates
- Dependency Updates
- Dependency Updates
- Implemented case-insensitive columns on import
- Dependency Updates
- Dependency Updates
- Updated sqlite3 dependency to use @vscode/sqlite3 for npm audit warning
- Downgraded dtslint to 3.4.2 for npm audit warning
- Support for opening multiple sqlite databases
- Basic TypeScript support (Matt Moran)
- Readme updates
- Dependency updates
- Husky and Prettier
- Downgraded node-sqlite3 library to released version
- Added release-it
- Updated pinned node-sqlite3 library
- Switch to recursive-copy library
- Change pinned node-sqlite path
- Dependency updates
- Dependency updates - pinned sqlite3 version to solve security issue: TryGhost/node-sqlite3#1483
- Added database optimizations to greatly speed up import.
- Fix for timetable_notes_references schema
- Dependency updates
- Fix for timetable_notes_references schema
- Dependency updates
- Dependency updates
- Use eslint instead of xo
- Agency assignment for multi-agency GTFS in getShapesAsGeoJSON
- Dependency updates
- Better error messages for missing config
- Better error messages for invalid paths in config
- Updated minimum node.js verstion to 14.17.0
- Added github action tests for node 16
- Dropped github action tests for node 12
- Tests for invalid path in config
- Use copy-dir library
- Dependency updates
- Converted to ES Module
- Renamed
gtfs.import
togtfs.importGtfs
- Renamed
gtfs.export
togtfs.exportGtfs
- Converted to ES Module
- Dependency updates
- Dependency updates
- Tests for GTFS-ride methods and models
- Dependency updates
- Exclude timestamp fields from export
- Dependency updates
- Updated transfers.txt model
- Dependency updates
- Support for
gtfsPath
,gtfsUrl
,exportPath
andsqlitePath
parameters forgtfs-import
andgtfs-export
scripts.
- Removed need for
agency_key
in config.json - use sanitized version of firstagency_name
in agencies.txt
- Dependency updates
- Update getDB test to handle unlimited serviceIds
- Readme updates
- Reorganize table creation
- Better SQLite escaping
- Dependency updates
- GTFS-ride models and methods
- Support for exportPath config option
- Use pluralize library
- Updated github actions to test PRs and node 14.x
- Better default sqlitePath
- Detect TTY and use \n if not
- Better error message when sqlitePath is invalid
- Dependency updates
- Better default GTFS in config-sample.json
- Skip creating tables for excluded files
- Dependency updates (fixes https://github.com/advisories/GHSA-qqgx-2p2h-9c37)
- Improved shapes query
- Use unzipper library to handle poorly formed zip files
- Dependency updates
- Don't log missing non-standard GTFS files
- Support for multiple agencies in one config file
- Dependency updates
- Support for timetable_notes.txt and timetable_notes_references.txt
- Expand model character limit
- Don't require stop_name in stops.txt
- Dependency updates
- Improved validation on import
- Support for extended GTFS route types
- Dependency updates
- Better error formatting
- GTFS import validation and better errors
- Fix for selecting a single field.
- Support for non-standard directions.txt file.
- Added getFareAttributes to README
- Fix for querying for null
- Dependency updates
- Fix geojson property formatting
- Updated model fields to latest GTFS spec
- Test for gtfs.getDb()
- Improved geoJSON generation
- Switched to SQLite
- Breaking changes for all queries
- Updated documentation
start_time
andend_time
fields intimetables.txt
- Improved mongo connection documentation
- Dependency updates
- Config option
csvOptions
to pass options tocsv-parse
.
- Support for zipped GTFS files with subdirectories
- Support for exporting GTFS zip files
- Better projections on all queries
dataExpireAfterSeconds
config optioncreated_at
field on each document
- Removed invalid required fields from models
- Removed
date_last_updated
field from agency
- Logging improvements
- Config option for custom logging function
- Use better temp directory for files
- Remove .git from published npm package
- Prevent timeout on all queries
- Index on stop_id
- Strip byte-order-markers if present when importing
- Support for GET headers
- Renamed config variable to
show_trip_continuation
- Changelog
- Fixed issue with geojson consolidation
- Updated all methods so that query objects remain unchanged
- Updated dependencies
As of version 1.0.0, all node-gtfs
methods have changed to accept a query object instead of individual arguments. This allows for all fields of all GTFS files to be queried using this library. Most method names have been changed to be more general and more specific methods have been removed. For example, getRoutes
now replaces getRoutesByAgency
, getRoutesById
, getRoutesByDistance
and getRoutesByStop
.
// Old method with individual arguments, no longer supported in `node-gtfs` 1.0.0
gtfs.getRoutesByStop(agency_key, stop_id)
.then(routes => {
// do something with the array of `routes`
})
// Query in `node-gtfs` version 1.0.0
gtfs.getRoutes({
stop_id: '123'
})
.then(routes => {
// do something with the array of `routes`
})
As of version 0.11.0, node-gtfs
methods don't support callbacks. Use promises instead:
gtfs.getAgencies()
.then(agencies => {
// do something with the array of `agencies`
})
.catch(err => {
// handle errors here
});
Or, you use async/await:
const myAwesomeFunction = async () => {
try {
const agencies = await gtfs.getAgencies();
} catch (error) {
// handle errors here
}
}