OpenTripPlanner 101

If you are looking for a reliable, flexible, and open-source solution for planning your trips using public transportation, bicycling, walking, and other mobility options, you might want to check out OpenTripPlanner (OTP). (I've been a huge fan of it for a while now!) Unlike proprietary options like Google Maps or Apple Maps, OTP is customizable, extensible, and interoperable with open standard data formats such as OpenStreetMap and GTFS.

Here are some of the reasons why OTP is better than Google Maps or Apple Maps for transit routing and trip planning:

All in all, OpenTripPlanner offers many advantages over Google Maps/Apple Maps when it comes to transit routing and trip planning. If you want to try it out yourself, you can use one of the public instances hosted by various organizations around the world or set up your own instance using the instructions provided in the documentation! But I get it, all the Java commands can be daunting at times -- I had a bunch of trouble setting it up too. I'm here to show you how to set up an instance more quickly!

Setting up an OpenTripPlanner instance locally

If you want to set up your own OTP instance locally, you can use otp2-setup which provides a Makefile that automates the tasks of downloading all the steps (OTP jar file, OSM data, GTFS data) and building a graph for a given region into a couple commands! (A region is defined by a name and a bounding box that specifies the area of interest).

Prerequisites

To use otp2-setup, you need to have the following installed on your machine:

You can check if you have these tools by checking for their version by running something like java -version or make -v in your terminal.

Installation

First, clone the repository from github by running:

git clone https://github.com/leonardehrenfried/otp2-setup.git

This will create a folder called otp2-setup in your current directory. You can switch into this folder by running:

cd otp2-setup

Usage

To see the list of available regions, you can view the repository's updated folders.

Once you have chosen (or added) a region, you can build a graph for it by running:

make build-<region>

For example, if you want to build a graph for Portland, you can run:

make build-portland

To run OTP with the previously built graph, run:

make run-portland

Once that's done, you can now run your instance at http://localhost:8080! You'll be able to plan trips or use OTP in conjunction with research, work or pure fun!

Happy trip planning!

© Adriana Ceric