Retrieve public transport information for a city


I am trying to analyse the public transport infrastructure of cities (in Germany), so that means I am looking for all bus, tram and subway lines (=relations) within a city.

To get the strength of the public transport network, I also need to know how often this bus/tram/subway travels that route per week to get a reasonable estimate (does not need to be 100% precise).

I have been thinking for a while on how to achieve this and my best idea right now is to (somehow) fetch all the relations from OSM data and cross-reference the line’s “ref” with timetable data and hope it works out.

I found this old post here for getting OSM Data ( Retrieve all bus routes for a given city - OSM Help ) but it recommends not using the API for a large data retrieval and instead download the data and analyse it with another tool that I am not familiar with.

This leaves me with some questions:
a) How do I query all relations that I need?
b) How do I limit the query to (roughly) the city/municipality that I am analysing? (Just a radius from city centre can be way off)
c) Does anyone have an alternate suggestion for me to achieve this analysis more easily? I just need a good indicator for public transport network strength (only looking at local/short-distance travel) and the total amount of km travelled by public transport vehicles in a week seems like a decent estimation.

Any ideas? :slight_smile:

4 posts - 3 participants

Read full topic

Ce sujet de discussion accompagne la publication sur