Overpass turbo query, @count use

http://overpass-turbo.eu/s/ESJ

Remove // from line 6 and run again. You now see the house count and total at the bottom of the page when you scroll down.

How can I get it to display it this way:

@count addr:street
113 Thistle Drive
81 Argyl Place
194

I don’t need to see every house being listed.

And as an enhancement, can it be done all in one query, both display the map and the count without having to run the query twice?

Apologies for posting english in German forum. It looks like the most active forum.

That’s not possible, as it woud mean to return both CSV and XML format at the same time. What you want is basically:


[out:csv(num,"addr:street")];

way["addr:street"]({{bbox}});
for(t["addr:street"])
(
  make stat num=count(ways),"addr:street"=_.val;
  out; 
);

http://overpass-turbo.eu/s/EST

Is there a way to get this to sum the count producing 194 in the last line

Sure:


[out:csv(num,"addr:street")];

( way["addr:street"~"^(Thistle Drive[0-9a-zA-Z ]{0,10})$"]({{bbox}});
  way["addr:street"~"^(Argyll Place[0-9a-zA-Z ]{0,10})$"]({{bbox}});
);
._->.a;

for(t["addr:street"])
(
  make stat num=count(ways),"addr:street"=_.val;
  out;
);

make stat num=a.count(ways);
out;

Is it possible to have this result on the data tab http://overpass-turbo.eu/s/ET1
and this result on the map tab http://overpass-turbo.eu/s/ESJ
with one query?

As I said earlier that’s not possible. You cannot mix csv and json/xml in one query.

What’s the neatest way this can be output to json/xml on the data tab,
with this http://overpass-turbo.eu/s/ESJ on map tab?

You’ll need to be a bit more specific what you mean by “neatest”, as I don’t have a crystal ball around here. The result will always include all the nodes to display some geometry data on the map, and the stats info will be in some XML/JSON. To an average user that’s probably not “neat”. However, that’s pretty much what’s possible with overpass turbo. If it doesn’t fit your needs I’m afraid you’ll have to write your own web app somehow.