0

I am trying to build subway maps using overpass-turbo and output in JSON. I only want the routes (ways) and the stations (nodes) for each network. This is what I have so far:

[out:json];
(
  relation["network"="NYC Subway"];
);
out body;
>;
out skel qt;

With this query, I not only get the station nodes, but also nodes for exits, platforms, etc. for each station. I only want the 'main' station node as shown in this picture: main_station_node

These nodes have attributes public_transport=station and railway=station while the exits and platforms do not. I am having trouble filtering only these main station nodes in overpass. I have tried this:

[out:json];
(
  relation["network"="NYC Subway"];
  node(r)["railway"="station"];
);
out body;
>;
out skel qt;

However, this is still giving me nodes for exits, platforms, etc.

1 Answer 1

1

The following should do it https://overpass-turbo.eu/s/1C00

/*
Get NYC Subway station nodes & Railway subway ways
*/

[out:json];

(
  // get subway nodes
  node["network"="NYC Subway"]["railway"="station"]({{bbox}});
  // get subway ways/'lines'
  way[railway=subway]({{bbox}});
);

out body;
>;
out skel qt;

Subway Lines and Nodes in Overpass Turbo

18th Street Results

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.