I was wondering if anyone had a good tutorial for Open Trip Planner. I am not an experienced programmer and I am having a lot of trouble understanding what the documentation wants me to do. I got through basic usage, but after that I became very confused. For example, I think the next relevant section is configuration. The first paragraph is about build directories. What exactly is a build directory? I've looked all over the internet for, but I didn't see any tutorials, and only a handful of stack overflow/exchange questions.
2 Answers
I have written a tutorial on using OTP that might be useful:
https://github.com/marcusyoung/otp-tutorial
It's aimed at beginner/intermediate users of OTP (setting up and query an OTP instance, automation using some R functions) rather than developers looking to amend OTP code.
Marcus
TLDR; I have not seen full tutorials, but below are links I've found useful in my own exploration.
As far as I can tell OTP is under heavy development and won't flesh out documentation until all the underlying functionality is solid and they're ready for a v1.0 release.
Trolling through their mailing list the general theme of response to inquiries on "how to do X" involves learning to program in Java to write your own analysis calling OTP classes/objects. One notable exception is where the ScriptingAPI author cleaned up a replicable travel time matrix repository based on this user's cut which shows how to use Jython scripting to calculate a travel time matrix.
To your question about build directories my current understanding is it is just the directory structure laid out in the Routing section of the configuration page, and I think the main things to know are:
- OTP's home directory (where the
otp-...jar
file lives), default is/var/otp
on Linux machines (when you build the graph you can set this to wherever you want by adding--basePath [home-directory]
) - the graph directory, which defaults to
[home-directory]/graphs
but you can similarly set with a--graphs /path/to/graphs
flag when launching OTP - the router directory, which defaults to
[graphs-directory]/[routerID]
- I think this is technically optional but allows you to have multiple regions and only run OTP for one of them (by setting the--router '[routerID]'
flag on OTP launch) - the
build-config.json
file tells OTP what options to set when building the underlying graph, as I'm sure you've seen the configuration page mentions the build-config file but the only complete view I've seen of the options is in the source code router-config.json
includes default routing request configurations (walking speed, etc), if it's in your router directory it'll be used when the graph is built
Another useful thing that I saw somewhere in the documentation is running java -jar otp-0.19.0-shaded.jar --help
will tell you what all flags OTP accepts, which is then useful in searching the source code for functionality