NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Regularly I see someone say something like, "There are N cases of foo=bar in the map".

Is there an easy way to get a count of the hits using Overpass Turbo? I can see the data pane, but it would seem I need to do a <ctrl>+<f> search for foo=bar, copying the output syntax exactly, to get a count.

Forgive me if I'm missing something obvious here: I've checked the titles of ~50 questions and also the documentation on the wiki here: https://wiki.openstreetmap.org/wiki/Overpass_turbo#Saving_and_sharing_queries

asked 24 Oct '19, 12:50

eteb3's gravatar image

eteb3
295131524
accept rate: 6%

edited 24 Oct '19, 13:18

1

for any query you run on Overpass Turbo, the counts are displayed in the right bottom corner, on top of the map

(25 Oct '19, 04:14) escada
2

Not relevant to this query but generally taginfo is useful https://taginfo.openstreetmap.org/

(25 Oct '19, 05:05) nevw

Based on the pharmacy example on this page I tried

[out:json][timeout:25];
(
  node["highway"="bus_stop"]({{bbox}});
  way["highway"="bus_stop"]({{bbox}});
  relation["highway"="bus_stop"]({{bbox}});
);
out count;

which for the area selected returned

{
  "version": 0.6,
  "generator": "Overpass API 0.7.55.1009 5e627b63",
  "osm3s": {
    "timestamp_osm_base": "2019-10-24T15:04:02Z",
    "copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
  },
  "elements": [

{
  "type": "count",
  "id": 0,
  "tags": {
    "nodes": "728",
    "ways": "0",
    "relations": "0",
    "total": "728"
  }
}

] }

permanent link

answered 24 Oct '19, 16:08

EdLoach's gravatar image

EdLoach ♦
19.5k16156280
accept rate: 22%

Thank you: that's more complex than I can probably handle at the moment, but great to be pointed to the list of worked examples on the wiki page you linked to: not a bad tutorial at all! :-)

(25 Oct '19, 09:25) eteb3
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×228
×9

question asked: 24 Oct '19, 12:50

question was seen: 3,085 times

last updated: 25 Oct '19, 09:25

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum