Code Monkey home page Code Monkey logo

docker-otp's Introduction

Urbica OpenTripPlanner Docker image

OpenTripPlanner (OTP) is a family of open source software projects that provide passenger information and transportation network analysis services. The core server-side Java component finds itineraries combining transit, pedestrian, bicycle, and car segments through networks built from widely available, open standard OpenStreetMap and GTFS data. This service can be accessed directly via its web API or using a range of Javascript client libraries, including modern reactive modular components targeting mobile platforms.

Usage

Build graphs using GTFS and OSM extract in the current directory:

docker run \
  -v $PWD:/graphs \
  -e JAVA_OPTIONS=-Xmx4G \
  urbica/otp --build /graphs

Run OTP server:

docker run \
  -p 8080:8080 \
  -v $PWD:/var/otp/graphs \
  -e JAVA_OPTIONS=-Xmx4G \
  urbica/otp --server --autoScan --verbose

...or run OTP server with analyst module:

docker run \
  -p 8080:8080 \
  -v $PWD:/graphs \
  -e JAVA_OPTIONS=-Xmx4G \
  urbica/otp --basePath /data --server --analyst --autoScan --verbose

Basic Tutorial

Based on OpenTripPlanner Basic Tutorial.

Get some data

Get GTFS for Transit Schedules and Stops

mkdir -p ./graphs/portland
wget "http://developer.trimet.org/schedule/gtfs.zip" -O ./graphs/portland/trimet.gtfs.zip

Get OSM extract for Streets

wget http://download.geofabrik.de/north-america/us/oregon-latest.osm.pbf
osmconvert oregon-latest.osm.pbf -b=-123.043,45.246,-122.276,45.652 --complete-ways -o=portland.pbf
mv portland.pbf ./graphs/portland

Start up OTP

Build graph

docker run \
  -v $PWD/graphs:/var/otp/graphs \
  -e JAVA_OPTIONS=-Xmx4G \
  urbica/otp --build /var/otp/graphs/portland

Run OTP server:

docker run \
  -p 8080:8080 \
  -v $PWD/graphs:/var/otp/graphs \
  -e JAVA_OPTIONS=-Xmx4G \
  urbica/otp --server --autoScan --verbose

The graph build operation should take about one minute to complete, and then you'll see a Grizzly server running message. At this point you have an OpenTripPlanner server running locally and can open http://localhost:8080/ in a web browser. You should be presented with a web client that will interact with your local OpenTripPlanner instance.

This map-based user interface is in fact sending HTTP GET requests to the OTP server running on your local machine. It can be informative to watch the HTTP requests and responses being generated using the developer tools in your web browser.

Usage

There are a number of different resources available through the HTTP API. Besides trip planning, OTP can also look up information about transit routes and stops from the GTFS you loaded and return this information as JSON. For example:

We refer to this as the Index API. It is also documented in the OTP HTTP API docs.

docker-otp's People

Contributors

andreytyu avatar stepankuzmin avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

docker-otp's Issues

broken API / graphs dir not working

Thanks so much for this project. I hit a few hiccups following the README, but nothing insurmountable. At the end of it I got a working OTP web UI! Nice.

But I'm attempting to play around with transit isochrones and running into problems with API calls. Sample call:

http://localhost:8080/otp/routers/default/isochrone?fromPlace=29.7524,-95.347&mode=TRANSIT&date=08-23-2020&time=4:30pm&maxWalkDistance=500&cutoffSec=1800

results in output like this.

A few things to note:

  • I'm using default because the graph appears to build with an empty string as its name. This is confirmed when visiting http://localhost:8080/otp/routers/, which includes <routerId></routerId>.
  • using a router ID of default generates some results, but no transit--all the isochrones I get back are walking-only. If I set the mode to TRANSIT only (as above) I get back empty results.
  • the graphs directory in the image doesn't look like it's getting populated properly:
/var/otp/graphs # find .
.
./houston-gtfs.zip
./houston.osm.pbf
./otp.sh
./graphs
./Graph.obj
./houston_extract.sh

I'll go ahead and build my own Docker image, but I figured I might as well file a bug report in case anyone else is trying to get the API going with this one.

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.