Online update of OTP Graph

173 views
Skip to first unread message

Antonio Bucchiarone

unread,
Feb 20, 2018, 5:38:51 AM2/20/18
to OpenTripPlanner Developers
Dear members.
I would like to understand if there is someone had an experience to update the OTP graph on-the-fly. We need to udpate information like: blocked streets, not available bus stop, etc..
Since I'm using OTP in a real-time application I would like to update the graph every time we have such a notification and in a such a way that OTP will plan using and updated version of the graph.

Thanks a lot in advance
Antonio

--
Le informazioni contenute nella presente comunicazione sono di natura privata e come tali sono da considerarsi riservate ed indirizzate esclusivamente ai destinatari indicati e per le finalità strettamente legate al relativo contenuto. Se avete ricevuto questo messaggio per errore, vi preghiamo di eliminarlo e di inviare una comunicazione all’indirizzo e-mail del mittente.
--
The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you received this in error, please contact the sender and delete the material.

Andrew Byrd

unread,
Feb 23, 2018, 5:52:01 AM2/23/18
to Antonio Bucchiarone, OpenTripPlanner Developers
Hi Antonio,

There are several different ways of updating the graph in OTP. Some ways actually modify the graph structure, while others update auxiliary data structures like public transit timetables that are referenced by the graph during searches.

For public transit, OTP supports GTFS-RT trip updates. These can be loaded from a file or a URL, or provided in a continuous stream (differential mode) over websockets. For streets, some work has been done on dynamically changing street speeds.

There is some information (including example configuration files) in the OTP documentation:

There is not really any documentation on the speed updaters because that is a very experimental system built against an early version of OpenTraffic. If you’re writing your own code though that could be adapted to updating speeds or even blocking traversal of certain roads. The example class is:
org.opentripplanner.updater.traffic.OpenTrafficUpdater

The shared mechanism that would need to be used by a custom speed updater is:
graph.streetSpeedSource.setSnapshot(new StreetSpeedSnapshot(speedIndex));

You can see an example of this in org.opentripplanner.updater.traffic.OpenTrafficUpdater.

If you are looking for more specific information about configuration or extension points, you will need to be much more specific about what you’re trying to do and what data sources you’re using for people to be able to help you.

Regards,
Andrew

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antonio Bucchiarone

unread,
Feb 26, 2018, 10:02:25 AM2/26/18
to OpenTripPlanner Developers
Thanks Andrew,
is there any example on how the OpenTrafficUpdater can be used? For example 1) where the TrafficInformation are memorized to be used and with which format? 2) how the traffic info are used ? 3) are the OTP resulting plans have this information ?

Thanks a lot
Antonio
Andrew

To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-dev+unsub...@googlegroups.com.

Andrew Byrd

unread,
Mar 6, 2018, 3:29:56 AM3/6/18
to Antonio Bucchiarone, OpenTripPlanner Developers
Hello,

To my knowledge there are no examples, and you probably cannot use this code as-is. I would take it as an obsolete unsupported prototype.

The only way you will be able to use it is to work directly on the source code and build your own system inspired by the existing code. Where and how the traffic data are stored would be your own choice. I am not quite sure what kind of information you are seeking when you ask “how the traffic info are used”. I could say they are used to set the speeds on graph edges for routing, but that doesn’t tell you anything you don’t already know.

If you want to do the things you’re describing with OTP, you will need to work directly on the source code and trace the execution to understand how it works, or create a project to do so with other people. If this is outside the technical capacity of you, your organization, your subcontractors or collaborators, OTP is probably not suitable for the task at hand.

-Andrew

To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.

Antonio Bucchiarone

unread,
Mar 6, 2018, 10:58:52 AM3/6/18
to OpenTripPlanner Developers
Dear Andrew, Dear All
I'm implementing my updater following your suggestions. Thanks a lot.

To understand how the OTP plan method uses the speed factor to avoid zero speed edges, can you suggest the class or the piece of code where this is done now in the planning phase?

Moreover, where the trip alternatives are generated? Could be they more then one or OTP returns only one solution?

Many Thanks
Antonio
Reply all
Reply to author
Forward
0 new messages