A model of the static GTFS using sequelize.js.
Project is in alpha version. Currently tested with a small transit agency with PostgreSQL and PostGIS.
var GTFS = require('gtfs-sequelize');
var downloadConfig = {
gtfsUrl: 'http://feed.rvtd.org/googleFeeds/static/google_transit.zip',
downloadsDir: 'downloads'
};
var gtfs = GTFS(downloadConfig);
gtfs.downloadGtfs(function() {
//download has finished callback
});
var GTFS = require('gtfs-sequelize');
var pgConfig = {
database: 'postgres://gtfs_sequelize:gtfs_sequelize@localhost:5432/gtfs-sequelize-test',
downloadsDir: 'downloads',
gtfsFilename: 'google_transit.zip',
sequelizeOptions: {
logging: false
}
}
var gtfs = GTFS(pgConfig);
gtfs.loadGtfs(function() {
//database loading has finished callback
});
var GTFS = require('gtfs-sequelize');
var pgConfig = {
database: 'postgres://gtfs_sequelize:gtfs_sequelize@localhost:5432/gtfs-sequelize-test',
downloadsDir: 'downloads',
gtfsFilename: 'google_transit.zip',
isPostGIS: true,
sequelizeOptions: {
logging: false
}
}
var gtfs = GTFS(pgConfig);
gtfs.loadGtfs(function() {
//database loading has finished callback
});