Routing API enables developers to query routes and timetable related information using either REST or GraphQL interfaces.edit architecture image
Routing API is implemented using OpenTripPlanner.
OpenTripPlanner APIs provide access to static and realtime routing and transit information. Routing and timetable data is based on static GTFS and it is enriched by realtime information for those departures that have realtime information available. This means that results returned by OpenTripPlanner always contain realtime information should it be available.
If you need to make large amount of requests (e.g. requesting schedules from all stops) to the API, you might want to host the API locally. To run OpenTripPlanner with Docker, use command:
docker run --rm --name otp-hsl -p 9080:8080 -e ROUTER_NAME=hsl -e JAVA_OPTS=-Xmx5g -e ROUTER_DATA_CONTAINER_URL=https://api.digitransit.fi/routing-data/v2/hsl hsldevcom/opentripplanner
After OpenTripPlanner has built the routing graph, the API can be accessed from
REST interface is provided as it is available in OpenTripPlanner. First thing to do is to familiarize yourself with OpenTripPlanner documentation:
OpenTripPlanner requires developers to make API requests through routers. Digitransit providers routers for Helsinki region, the Waltti regions and entire Finland:
GraphQL API is built by us. Similarly to REST, GraphQL has different router endpoints for Helsinki region, the Waltti regions and entire Finland.
For more details about the GraphQL you can go to our GraphQL page
You can get access to GraphQL schema by running this example in GraphQL console
|https://github.com/opentripplanner/OpenTripPlanner||OpenTripPlanner upstream development on GitHub|
|https://groups.google.com/forum/#!forum/opentripplanner-dev||OpenTripPlanner forum for developers|
|https://groups.google.com/forum/#!forum/opentripplanner-users||OpenTripPlanner forum for end users|
|https://onebusaway.org/||OneBusAway: The Open Source platform for Real Time Transit Info|
|https://github.com/OneBusAway?utf8=✓&query=gtfs||GTFS related projects: Open-source transit app for real-time information|
|https://developers.google.com/transit/||Google developers transit community: Making public transit data universally accessible|
|https://github.com/conveyal/r5||Conveyal R5 development on GitHub: Rapid Realistic Routing on Real-world and Reimagined networks|
The resulting Docker image is called hsldevcom/opentripplanner and it is available at DockerHub. The image can be built using this build script. You might also want to take a look at the Travis build and configuration.
To run Docker container, run:
docker run -e OTP_DATA_CONTAINER_URL=http://otp-data-container:8080 -p 8080:8080 hsldevcom/opentripplanner
To access Docker container:
For More information about how to use Docker see docker info.