CREDS researcher, Malcolm Morgan, explores building tools to make transport research cheaper and easier.
When we think about reducing transport emissions, we often run into questions of what travel options people really have. For example, it might be easy for a person in London to have a low energy/carbon commute as there is good public transport and plenty of nearby jobs. On the other hand, a rural worker might have limited or no public transport options and have to travel further to find a job.
For individuals, this is easy to work out, a few minutes on Google Maps will tell you everything you need to know about your travel options. But for researchers, who want to know about whole populations, it can be a bit more problematic. Firstly, while Google doesn’t charge individuals for directions if you wish to bulk download data, it costs about $0.005 per route. That might not sound much, but the England and Wales travel to work dataset has 7 million Origin-Destination pairs. If you also wanted to consider different modes (e.g. walk, cycle, public transport, drive) you could rapidly end up paying more than $140,000 just for the data. The other problem with using a web-service is that you can only find routes in the present. You can’t ask Google how long it will take after High Speed 2 has been built, or how long it took before a bus service was cancelled.
So researchers both inside and outside of academia need ways to find millions of routes quickly, cheaply and with lots of control over the input data. This is why myself and colleagues turned to OpenTripPlanner (OTP) which has may benefits that make it suitable for our research, such as:
• It is free, open-source software, and uses open data as its inputs (OpenStreetMap)
• It supports a range of different transport modes, including some more unusual ones such as cycling to stations or park and ride
• You can edit any of the input data to add/remove roads or change public transport timetables
• It supports terrain mapping, crucial for walking and cycling.
But it had one big downside. OTP was designed to run public route planning websites, not as an analytical research tool. That’s why we developed OpenTripPlanner for R, a package for the statistical programming language R.
R is a free programming language for statistics and data analysis. Researchers use it due to its ability to process large and complex datasets quickly and produce outputs such as graphs and maps.
The package makes setting up OTP quick and easy as well as giving you the tools to generate as many routes as you want. Typically you can get between 10 and 50 routes per second depending on the performance of your computer, so producing millions of routes can be done in hours. We added some example data for the Isle of Wight to the package along with a tutorial to get you started. If all goes well, you can have a multi-modal journey planner running on your computer in around 10 minutes. We are keen to hear feedback from new users, so let us know if you have any problems or ideas about how the package could be improved.
Banner photo credit: Shutterstock