Local routing can be advantageous in terms of speed of execution and control over the weighting profile for different modes of transport.Disadvantages include the difficulty of representing complex networks locally; temporal dynamics (primarily due to traffic); and the need for specialized software such as ‘pgRouting’, an issue that developers of packages stplanr and dodgr seek to address.
Instead of routing all desire lines generated in the previous section, which would be time and memory-consuming, we will focus on the desire lines of policy interest.The benefits of cycling trips are greatest when they replace car trips.Clearly, not all car trips can realistically be replaced by cycling.However, 5 km Euclidean distance (or around 6-8 km of route distance) can realistically be cycled by many people, especially if they are riding an electric bicycle (‘ebike’).We will therefore only route desire lines along which a high (300+) number of car trips take place that are up to 5 km in distance.This routing is done by the stplanr function which takes straight lines in Spatial
or sf
objects, and returns ‘bendy’ lines representing routes on the transport network in the same class as the input.
We could keep the new route_carshort
object separate from the straight line representation of the same trip in desire_carshort
but, from a data management perspective, it makes more sense to combine them: they represent the same trip.The new route dataset contains (referring to route distance this time) and duration
fields (in seconds) which could be useful.However, for the purposes of this chapter, we are only interested in the geometry, from which route distance can be calculated.The following command makes use of the ability of simple features objects to contain multiple geographic columns:
There are many benefits of converting travel desire lines into likely routes of travel from a policy perspective, primary among them the ability to understand what it is about the surrounding environment that makes people travel by a particular mode.We discuss future directions of research building on the routes in Section .For the purposes of this case study, suffice to say that the roads along which these short car journeys travel should be prioritized for investigation to understand how they can be made more conducive to sustainable transport modes.One option would be to add new public transport nodes to the network.Such nodes are described in the next section.