NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello, I would like to extract a list of all the relations representing bus routes in a given city (i would then access their information via RelationFullRecur(relID) API). Let's say I would like all the bus routes in London, how would i do that? I could look at http://wiki.openstreetmap.org/wiki/Bus_routes_in_London but I'm looking for like something more automatic and programmable

Let's then extend it to include also tram routers, shuttles, and even boat routes (ie, all terrestrial public transportation services, nothing underground).

Thanks!

asked 24 Mar '16, 21:38

sandrotosi's gravatar image

sandrotosi
11112
accept rate: 0%


It appears you want to process data with the "osmapi" Python package. This package is a Python wrapper around OSM API functions. The RelationFullRecur(relID) method downloads a relation and all its members from the API using the relation/<id>/full API call. This should not be used for large scale data retrieval; if you're planning to download the complete surface transport network for one or more cities, or (even worse) if you plan do build that into some application that will be used by more people than just you, think again!

A suitable way to get all relations of a particular kind in a particular area is using the Overpass API; see for example the last answer on How to get tram stops and lines (routes).

Another option is simply downloading the full OSM data file for the region you're interested in and then pull the data from that; if you want to do that with Python, check out the Python bindings for the Osmium library.

permanent link

answered 24 Mar '16, 22:09

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

thanks for the references, I will look at them

(24 Mar '16, 22:27) sandrotosi

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×290
×179
×84

question asked: 24 Mar '16, 21:38

question was seen: 6,183 times

last updated: 24 Mar '16, 22:27

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum