duber
duber

Reputation: 2869

How do you find all subway stations in a city?

I'm looking to plot all the subway stations in a city, with many stations in foreign countries that don't readily provide geocoordinates or addresses for their stations. How would I use the Google Places API, OpenStreetMap, or any other service to return the geocoordinates of all subway stations in a city?

Upvotes: 0

Views: 2503

Answers (2)

Ilja Zverev
Ilja Zverev

Reputation: 953

The simplest way is using Overpass Turbo: I've prepared a query for you, just pan to your city and press "Run". To export found data, use "Export" tab. For example, you can download stations in GeoJSON.

You can probably get all subway stations for a country or two this way, but it could take some minutes.

Upvotes: 1

MaM
MaM

Reputation: 2069

AFAIK you can't use Google to get the data, as it's closed source.

For OSM you can query for railway=station tagged nodes (e.g. using OverpassAPI), but this includes also usual stations and not only subway. A better approach is to query for OSM 'route' relations that are tagged as route=subway and get all contained elements in a second step.

ÖPNVkarte and OpenPTmap use this technique to create a map styling focused on public transport.

Upvotes: 2

Related Questions