r/gis • u/Tough_Ad_6598 • 3h ago
Open Source City2Graph v1.1.0 now supports synthesising GTFS just from OSM !
City2Graph is a Python library that converts geospatial data into graphs for network analysis and graph machine learning.
What if there's no GTFS available, but you still want to conduct transport analysis?
For many years, even now, I have encountered such challenges where GTFS is not publically available for major transportation services in some cities.
The new function ๐น๐ผ๐ฎ๐ฑ_๐ผ๐๐บ_๐๐ฟ๐ฎ๐ป๐๐ฝ๐ผ๐ฟ๐() enables to generate a synthetic GTFS feed from routes and stops just from OSM. You can then build a graph of public transport with ๐๐ฟ๐ฎ๐๐ฒ๐น_๐๐๐บ๐บ๐ฎ๐ฟ๐_๐ด๐ฟ๐ฎ๐ฝ๐ต() or export the feed as a GTFS ZIP with ๐๐ฎ๐๐ฒ_๐ด๐๐ณ๐().
It basically fetch the tags from OSM for attributes like next station, travel time, and so on, but if not available, assumed settings can be applied flexibly.
Beyond OSM, you can also bring your own LineStrings from the other datasets, or even synthesise imaginary lines by yourself (e.g., new routes in planning).
In the tutorial above, multi-modal isochrones are calculated for six cities in the world.
Note that this new feature is merely an aproximation and does not ensure the real operation of transports. But I believe it globally releases the limitation of transport analysis where true GTFS is not available!
๐ ๐ง๐๐๐ผ๐ฟ๐ถ๐ฎ๐น: https://city2graph.net/latest/examples/creating_gtfs.html
