OpenTripPlanner tutorials
What is OpenTripPlanner?
OpenTripPlanner (commonly referred to as OTP) is an open-source multi-modal trip planner.
In other words, it's software that anyone can freely* use to build a transportation network and calculate travel itineraries, using one or more methods of transportation (such as buses, trains, bikes, walking, annd more).
Have a look at our OTP - OpenTripPlanner article for more information.
* OpenTripPlanner is distributed under the GNU Lesser General Public License version 3.
How to install OpenTripPlanner?
There's a few ways to do this depending on your technical expertise and requirements.
Note that the installation alone isn't enough to run an instance of OpenTripPlanner! You'll need data for that. Refer to the next section How to use OpenTripPlanner? when you're ready to launch.
a) Using Docker Compose (easy, recommended)
The easiest and fastest way to get started is to use Docker Compose based on a ready-made Docker container image.
This is ideal for beginners, a demo or a PoC.
In short, you just need to:
- Download and install Docker Desktop Docker Desktop.
- Download this 20-line docker-compose.yml file.
- Save the file in a new empty folder on your machine.
That's it!
This enables building an OTP graph with docker compose up otp-graph-builder-service and running its server with docker compose up otp-app-service.
Check out our tutorial on how to install and run OTP for details.
b) Using Java and a pre-built JAR file (intermediate)
Alternatively, if you want more control over the installation, you can:
- Download and install Java (or confirm you already have it by running
java -version). - Download OTP in the form of a runnable JAR file from Maven or GitHub Releases (select a version then pick the file ending with
shaded.jar, e.g.otp-2.6.0-shaded.jar). - Save the file in a new empty folder on your machine.
This enables:
- building the graph with
java -Xmx2G -jar otp-2.6.0-shaded.jar --build --save . - starting the server with
java -Xmx2G -jar otp-2.6.0-shaded.jar --load . - building and serving the graph in one step with
java -Xmx2G -jar otp-2.6.0-shaded.jar --build --serve /path/to/your-folder
Refer to OpenTripPlanner's Basic Tutorial for details.
c) Building from source (advanced)
- Get Java (see above).
- Download and install Maven.
- Clone OTP's GitHub repository.
- Make your changes to the codebase.
- Run Maven to build a JAR file.
Now you can run your own custom build of OTP using the same commands as with the previous installation method.
Refer to OTP's documentation for more information.
How to use OpenTripPlanner?
Regardless of how you've installed OpenTripPlanner, you can't run it until you've fed it with one or more datasets. Specifically:
- a road network (= OSM file)
- a public transport service (= GTFS Schedule file)
- the realtime updates for that public transportation service (= GTFS Realtime feed)
- the realtime offer of shared vehicles (= GBFS feed)
You can find out more about each file in this tutorial.
OpenTripPlanner demos & examples
TODO https://docs.opentripplanner.org/en/v2.2.0/Deployments/
OpenTripPlanner documentation
Still have questions? Check out OTP's official documentation or ask in the Gitter chat room.