OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2019-09-12 11:16:06

rkalasek
Member
Registered: 2019-09-12
Posts: 1

Overpass turbo search for the number of routes per sation

i am pretty new to this forum - and seriously trying to get a count of public transport bus routes per bus station. my recent experiments resulted in empty outputs. up to now i was able to "select" all nodes which are part of bus-routes that are selected via  node[highway=bus_stop]({{bbox}})->.alle

my code so far:

// query part for: “route=bus”
  node[highway=bus_stop]({{bbox}})->.alle;
  rel[route=bus](bn.alle)->.rel_alle;
  //way(r.rel_alle)->.way_m;
  node(r.rel_alle)->.node_m;

subsequently, to that, I've been trying to count the number of relations based on that set of stations (i.e. nodes) - but couldn't manage to get any results.
my experimental code

foreach -> .myStop (
    .myStop out;
    (rel(bn.myStop););
    out count;

thx for help in advance
robert

Offline

#2 2019-09-13 14:00:55

AdVerburg
Member
From: Goes, The Netherlands
Registered: 2015-05-25
Posts: 90

Re: Overpass turbo search for the number of routes per sation

Hi Robert,
I think next part will do what you want.

// In http://overpass-turbo.eu select your area of interest,
// then hit the run-button.
[out:csv(::"type",::"id", name,::"count")]; // text output (no map)
(
  node["highway"="bus_stop"]({{bbox}});
);
foreach->.a( // walk through previous selection
  (.a;);out;
	rel[route=bus](bn.a);
  	out count;
	);

Offline

Board footer

Powered by FluxBB