I would like to modify a simple overpass turbo query, for example
way[building](area.searchArea);
but I need only the number of buildings, no matter where they are on the map. I would like to know for example the number of buildings in my city. But running such query will force to download a lot of MB of data. How to do that?
The Overpass Query Language (Overpass QL) includes a statement to count the number of elements without downloading the actual elements:
out count;
This will return the number of elements, split up into nodes, ways and relations, and the total.
Just add this statement after your query for buildings, and don’t use any other out statement to avoid downloading the actual elements:
{{geocodeArea:gostkowice}}->.searchArea;
way["building"](area.searchArea);
// print result count
out count;
In overpass-turbo.eu you can find the results under the Data tab. There should be no results visible on the map of course, displaying the buildings would require downloading the data.
I saw it before but this doesn’t help. There are no examples how to use it.
I tried for example count(way)building=yes; but it didn’t work.
Documentation for overpass language on Wiki is really poor. There are almost no examples.
Thanks, it works.
I have another question - would it be possible to expand this query to generate a table with values for a key? For example:
888888 building=yes
7777 building=apartments
555 building=garage
As per counting diffrent tags, consider using https://ohsome.org/apps/dashboard/ , noting however you can only count at powiat level and above for Poland.