Skip to content

ays-dev/gtfs-sequelize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gtfs-sequelize

npm version

A model of the static GTFS using sequelize.js.

Current Status (as of 2015-08-17):

Project is in alpha version. Currently tested with a small transit agency with PostgreSQL and PostGIS.

Usage:

Downloading the GTFS File:

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
});

Loading GTFS into Database:

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
});

Loading into a DB with PostGIS installed:

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
});

About

A model of the static GTFS using sequelize.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%