Skip to content

Instantly share code, notes, and snippets.

@chriswhong
Last active September 8, 2019 12:03
Show Gist options
  • Save chriswhong/24f6dddfd62d1a2737a244bf8c03b84b to your computer and use it in GitHub Desktop.
Save chriswhong/24f6dddfd62d1a2737a244bf8c03b84b to your computer and use it in GitHub Desktop.
Run open trip planner docker container for NYC

This set of commands is for setting up an open trip planner instance for New York City. OTP requires GTFS data and OSM streets data to build a graph, which it uses for trip planning.

Lucky for us, someone here dockerhub has left a nice CLI command to build the graph and run the container, but we need to get the data first.

The data are downloaded on the host machine. For me, this is a digitalocean droplet running ubuntu 14.

First, get GTFS for the New York City Subway from the MTA's downloads page: wget http://web.mta.info/developers/data/nyct/subway/google_transit.zip Next, get OSM city extract for NYC. Thanks Mapzen! https://s3.amazonaws.com/metro-extracts.mapzen.com/new-york_new-york.osm.pbf

Finally, run the following docker command: docker run -it -v $(pwd):/var/otp/graphs opentripplanner/opentripplanner --build /var/otp/graphs --analyst

NYC is big, it takes a long time to build the graph.

docker run -p 8080:8080 -p 8081:8081 -it -v $(pwd):/var/otp/graphs opentripplanner/opentripplanner --router '' --server --analyst

docker run -p 8080:8080 -p 8081:8081 -it -v $(pwd):/var/otp/graphs opentripplanner/opentripplanner --build /var/otp/graphs --router '' --server --analyst

once the container is built with one of the above commands, commit it and then run it again without build... I think...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment