Giter Club home page Giter Club logo

gtfs's Introduction

GTFS and Real-Time Extension

This repository contains code used to parse General Transit Feed Specification (GTFS) and GTFS Realtime files made available as binary files using the Protocol Buffers. The GTFS schema is used by many municipalities around the world to provide information about public transport services. In our examples we use the data published by the municipality of Rome. The GTFS schema is divided in two categories, static and real-time. The first concerns the structure of the service such as routes and stops, the second concerns waiting times at bus stops, travel times, the position of the vehicles and more. The Open Data section of the host of the data contains technical information. Static data is released in a zip file once a day and provides information regarding line changes, strikes or other. The monitoring files concerning the wait times are released every 30 seconds in binary format according to the Protocol Buffers standard.

In order to parse the data we need to download the Protocol Buffers compiler choosing the executable according to our operating system. The compiler is used to create the source files from the GTFS or GTFS Realtime schema in one of the supported languages, Java in our case. In this project we use version 3.15.3 for Windows protoc-3.15.3-win64.zip The GTFS Realtime schema is used to represent the actual status of the fleet. The option java_package inside the gtfs-realtime.proto file can be used to set the package of the generated source code. If we want to use the generated code within a Maven project, like the present one, we can for example save the gtfs-realtime.proto file in the src/main/resources folder, set the output folder to src/main/java and execute the command

$ protoc src/main/resources/gtfs-realtime.proto --java_out=src/main/java/ 

The compiler will create the Java class with the interfaces used to access the data delivered as binary files.

gtfs's People

Contributors

luigiselmi avatar

Watchers

 avatar

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.