1.0.4 • Published 9 years ago

gbfs2geojson-js v1.0.4

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

gbfs2geojson-js

NPM module to help with easy GBFS feed integration.

Usage

Instantiation

var gbfs2geoJSON = require('gbfs2geoJSON-js');

// auto-discovery URLs for all NABSA bikeshares are found at:
// https://github.com/NABSA/gbfs/blob/master/systems.csv
var autoDiscoveryUrl = "https://gbfs.citibikenyc.com/gbfs/gbfs.json";

var stationStatusUrl = "https://gbfs.citibikenyc.com/gbfs/en/station_status.json";
var systemAlertsUrl = "https://gbfs.citibikenyc.com/gbfs/en/system_alerts.json";

Convert GBFS data for all feeds into geoJSON

var data = {};

gbfs2geoJSON.getAllData(autoDiscoveryUrl, data, function(data, err) {
  if (err) {
    console.log(err);
  }
  console.log(data);
});

Convert GBFS data for Station Information and System Alerts into geoJSON

var data = {};

gbfs2geoJSON.getStatusAndAlerts(stationStatusUrl, systemAlertsUrl, data, function(data, err) {
  if (err) {
    console.log(err);
  }
  console.log(data);
});
1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago