Retrieving all subway systems

Hello! It’s my first time in the forum.

I’ve been trying to retrieve all South America subway systems for some weeks (I’m interested in stations), and I’m having some problems.

First, I tried selecting all nodes with tag station=subway with osm2psql. The main problem with this approach is that I don’t know to which subway system and line belongs each station.

Then I tried using relations (route=subway). I mean, selecting nodes depending on the relation they were members of. I posted a question in gis.stackexchange (http://gis.stackexchange.com/questions/126774/osm-relation-tags-to-nodes) and I even wrote a program that attaches the tags of the relations to the member nodes (so I can know the line of each station) (The program is here: https://github.com/BrunoSalerno/tags2nodes). The problems: 1. some station nodes are not members of any relation (sometimes, also, roles are missing). 2. some relations have only ways as members, and no the station nodes. 3. Other relations have nodes, but they are not tagged as station=subway

I don’t know what to do. What do you suggest? I’m thinking that I could try to retrieve ways (subway lines=> railway=subway) and then see which nodes are intersected (subway stations).

Thanks in advance

It seems that tagging of subways all over the world has slightly different schemes in OSM data.

I can only recommend to do some investigations via overpassAPI or itd “GUI” names overpass-turbo.eu

you can query there for elements by their tags and even by type … like ways, relations, nodes, and even members of relations.

Have a closer look at the documentation in the OSM wiki … there are numerous examples how to query and export data that you need.

http://wiki.openstreetmap.org/wiki/Overpass_API and http://wiki.openstreetmap.org/wiki/Overpass_turbo

Come back here to ask in detail if you get stuck somewhere.

Thanks Stephan.
Yes, it look’s like I have to do deeper investigations. Anyway, I think that, as you suggest, perhaps there is not an unified way to retrieve many different subway systems.