Coder Social home page Coder Social logo

derhuerst / gtfs-rt-differential-to-full-dataset Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 43 KB

Transform a differential GTFS Realtime feed into a full dataset/dump.

Home Page: https://github.com/derhuerst/gtfs-rt-differential-to-full-dataset#gtfs-rt-differential-to-full-dataset

License: ISC License

JavaScript 100.00%
public-transport transit gtfs-rt gtfs-realtime differential

gtfs-rt-differential-to-full-dataset's Introduction

gtfs-rt-differential-to-full-dataset

Transform a continuous GTFS Realtime (GTFS-RT) stream of DIFFERENTIAL incrementality data into a FULL_DATASET dump.

Note: Right now, this package does not obey the draft DIFFERENTIAL spec exactly. See below and #1 for details.

npm version build status ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installing

npm install gtfs-rt-differential-to-full-dataset

Usage

const toFullDataset = require('gtfs-rt-differential-to-full-dataset')

const toFull = toFullDataset({
	ttl: 2 * 60 * 1000, // 2 minutes
})
toFull.on('error')

differentialFeedEntities.pipe(toFull)
setInterval(() => {
	console.log(toFull.asFeedMessage())
}, 5000)

toFull will be a writable stream in object mode that expects JS objects in the FeedEntity structure/format.

toFull.asFeedMessage() returns a protocol-buffer-encoded FeedMessage with all relevant FeedEntitys that have been written into toFull so far.

toFull.nrOfEntities() returns the number of FeedEntitys that are currently part of the FeedMessage.

Contributing

If you have a question or have difficulties using gtfs-rt-differential-to-full-dataset, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

gtfs-rt-differential-to-full-dataset's People

Contributors

derhuerst avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gtfs-rt-differential-to-full-dataset's Issues

add test cases from Netherlands

I read somewhere that the Dutch realtime public transport data infrastructure sends individual FeedEntity-like items over ZeroMQ.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.