Coder Social home page Coder Social logo

public-transport / gtfs-rt-inspector Goto Github PK

View Code? Open in Web Editor NEW
29.0 6.0 4.0 9.94 MB

Web app to inspect & analyze any GTFS Realtime feed.

Home Page: https://public-transport.github.io/gtfs-rt-inspector/

License: ISC License

JavaScript 90.19% HTML 9.81%
gtfs gtfs-realtime gtfs-rt public-transport transit

gtfs-rt-inspector's Introduction

gtfs-rt-inspector

Web app to inspect & analyze any CORS-enabled GTFS Realtime (GTFS-RT) feed.

It is deployed at public-transport.github.io/gtfs-rt-inspector/.

support me via GitHub Sponsors chat with me on Twitter

screenshot of the inspector view showing a feed's data screenshot of the map view showing a feed's vehicle positions

Note: If your feed doesn't allow Browser-based access because it does not set CORS headers, as a workaround, you can run e.g. warp-cors locally to proxy it with CORS headers. (Do not deploy such a proxy to production if you don't know about the consequences!)

supported URL parameters

URL parameter description default
feedUrl URL of the GTFS-RT feed
feedSyncStopped if the feed should be re-fetched periodically true
feedSyncInterval how often the feed should be re-fetched, in seconds 30
view tab shown in the UI log
focusedTripId trip_id whose shape is highlighted on the map
shapeIdsByTripIdUrl URL of the trip_id => shape_id JSON file, used for showing a vehicle's trip's shape on the map /shape-ids-by-trip-id.json
shapeUrl URL template for a shape, used for showing a vehicle's trip's shape on the map /shapes/{shape_id}.geo.json

Contributing

If you have a question or need support using gtfs-rt-inspector, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, use the issues page.

gtfs-rt-inspector's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gtfs-rt-inspector's Issues

improve map view UX

  • on mouseover/click on a vehicle, show its properties (e.g. vehicle.(id, label, license_plate) & trip.(trip_id, route_id, start_date, start_time))
  • on feed refresh, only fit the map viewbox to the data if the user hasn't zoomed so far

support GTFS-ServiceChanges

GTFS-ServiceChanges v3.1 has several new features:

  • GTFS-TripUpdates v3 extends GTFS-TripUpdates to change values on a trip object, either by directly providing the new values (e.g. new trip headsign or new trip short name) or by referencing another entity already defined in the (CSV) GTFS (e.g. a shape, a route, or platform). The only limitations being that no stop time can be added, and all stop_id and stop_sequence pairings in the TripUpdate must match the same GTFS static trip (it is allowed to have SKIPPED stops within a TripUpdate, as the stop_sequence for the stops do not change).
  • GTFS-NewTrips allows defining completely new trips in real-time, which is useful for replacement shuttles, unplanned event-specific shuttles, or detours that change the stop_sequences of a trip.
  • GTFS-NewShapes allows adding new shapes in real-time, which is useful, for example, when a road is closed and therefore the path of the vehicle won’t be the same as planned, or when a trip is shortened by having an early terminus.
  • GTFS-NewRoutes allows adding new routes in real-time, which is useful, for example, when a bus replacement shuttle does the same trip as the service it’s replacing, but with a bus.
  • GTFS-NewStops allows adding new stops in real-time, which is useful when a bus replacement shuttle stops at a street corner without bus stop, or when a stop is moved for unplanned reason (e.g. demonstration, road accident, emergency work). GTFS-NewStops must be used with GTFS-NewTrips - new stops cannot be used in TripUpdates.
  • GTFS-ServiceUpdates allows activating or deactivating service in real-time, which is useful for disabling or enabling many trips at the same time, such as planned services for unexpected occasions (e.g: snow bus routes, light-rail diversion in case of demonstration downtown).

display feed fetching errors

The UI should show that an error occurred fetching the feed.

  • feed URL
  • status code & msg
  • a note about common mistakes (e.g. for #8)

Question: Example Call?

Hi there,
Thank you so much for providing and maintaining this repository.

Do you happen to have an example call for

https://public-transport.github.io/gtfs-rt-inspector/

to see it in action with an example GTFS Realtime feed that I can expect to work?

I tried a few example GTFS Realtime feeds from this catalogue without success.

Cheers!

add statistics view

Analyses that would probably be useful:

  • delay distribution across all vehicles, also showing cancellations
  • delay by line: min/average/max/standard deviation
  • delay by "time running", e.g. as scatterplot matrix

License?

This looks cool!

Could you add an OSS license so everyone knows what the code is licensed under?

CORS error when trying to load a .pb file

Hi 👋🏻

First and foremost, thanks for building this great tool!

I'm experiencing an issue when trying to inspect a .pb file of the GTFS RT of the Netherlands (http://gtfs.ovapi.nl/nl/vehiclePositions.pb)

When inspecting the dev tools I can see in the network tab that the request to fetch the file goes wrong, it might be the CORS policy, not sure.

Any idea how we can solve this?

add "first steps" view

We should add a "first steps" view that explains

  • what this web app app is about
  • what GTFS-RT is
  • how to get a GTFS-RT feed URL
  • basics of the UI

fix protocol buffers parsing

gtfs-rt-inspector uses gtfs-rt-bindings, which in turn uses protocol-buffers. Unfortunately, it parses missing optional numeric fields as 0 instead of null (or undefined), so we can't distinguish a missing delay value from a delay of 0.

We should either fix this in protocol-buffers, or consider using gtfs-realtime-bindings.

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.