Putting transit on a map with GeNet

Using our open-source tool to modify transport network representations

Kasia Kozlowska
Arup’s City Modelling Lab
4 min readApr 23, 2021

--

Kasia is a data scientist working with agent-based models in Arup’s City Modelling Lab.

Arup’s City Modelling Lab builds agent-based models of cities, regions and nations with the aim to improve the way we travel, both in individual terms, to improve quality of life, and collectively, making transport more sustainable. We can use these models to test and quantify reactions to different interventions we think would impact the agents or environment. In this blog post we will talk about adding new public transit (PT) services to existing — baseline — transport networks, which is one example of an intervention we might consider for scenario modelling.

In one of our previous blog posts we introduced GeNet as a tool for building transport scenarios and gave a few examples of what it could be used for. You could for example use it to add new highways, restrict speed or capacity on specific roads, or generate road pricing schemes.

Soon, we will be releasing a new feature which enables you to snap PT services to the road network. These services can be read from General Transit Feed Specification (GTFS) inputs or directly generated using GeNet classes which help to keep the right data structure throughout.

We build our networks using Open Street Map (OSM) data. GTFS data doesn’t come pre-processed to fit neatly in our road network. From GTFS we derive the stops between which PT vehicles are travelling and at what times. This amount of information may be sufficient for some modes, like rail, but for others, snapping and routing services onto the network is essential. In our models it is crucial that buses come in contact with the rest of the traffic to simulate conditions on the network realistically.

Sydney

To demonstrate this new feature, we are using Sydney, which has a vibrant PT scene. The GTFS dataset we are working with has five modes: bus, rail, tram, subway and ferry. For our modelling purposes we look at a single indicative day: here we chose 16th June 2020.

Transit vehicles per hour. Generated using http://kepler.gl/ and one of the automated standard outputs in GeNet.

We need a network for the vehicles to move on. Using GeNet and using OSM, we generated a Sydney road network.

Road network around Sydney. Generated using http://kepler.gl/.

For this demonstration we chose the Bus 400 between Bondi Junction and Sydney Airport.

Bus 400 route as featured on the Transport for New South Wales website.
Bus service 400 before and after being snapped to the network. Generated using http://kepler.gl/.

While not perfect, the snapping and routing in GeNet provides a good approximation for where this bus will interact with other traffic.

Technical Notes

We represent the problem of PT stops finding the closest part of the physical network to snap to (e.g. a road for a bus) in such a way that the choice of the stops-to-network relation is informed by the final route between the stops.

Under the hood, GeNet uses a graph optimisation problem called Maximum Stable Set.

This is a problem of choosing as many nodes as possible such that none of the selected nodes connect via an edge in the graph. Both the transport network and the PT schedule are represented as graphs, but here we are talking about an abstract graph that is purpose-built for the PT service that needs snapping.

The nodes in the graph represent possible pieces of the network available for snapping for a given stop. Each stop has a catchment, within which all nodes are completely connected — we only want to be able to choose one node from a stop catchment. We compute the shortest path lengths for combinations of nodes between catchments that will require a route — this is defined by the order in which the PT service travels between its stops. The path lengths are used as coefficients and help select nodes for the service which result in an overall shortest route.

Artist’s impression of a Max Stable Set problem. We add an edge between nodes in two different catchments if there isn’t a path between them. This means only one of those nodes can be selected.

Conclusions

With this functionality we can now generate a complete multimodal (PT) network with GeNet. Its prime objective is to generate scenario networks to test impacts of adding a small number of new PT services.

If you work with transport networks and have enjoyed reading this post, checkout GeNet on github. We would appreciate any comments or suggestions you may have, and would be more than happy to see people get involved and contribute their code and/or experience to the project — here is a link to the contribution guide with some ideas on how you could contribute.

--

--

Kasia Kozlowska
Arup’s City Modelling Lab

Software Engineer in the City Modelling Lab in Arup, London.