{"action":"created","issue":{"url":"https://api.github.com/repos/drolbr/Overpass-API/issues/197","labels_url":"https://api.github.com/repos/drolbr/Overpass-API/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/drolbr/Overpass-API/issues/197/comments","events_url":"https://api.github.com/repos/drolbr/Overpass-API/issues/197/events","html_url":"https://github.com/drolbr/Overpass-API/issues/197","id":57638431,"number":197,"title":"New filters based on counting functions","user":{"login":"mmd-osm","id":5842757,"avatar_url":"https://avatars.githubusercontent.com/u/5842757?v=3","gravatar_id":"","url":"https://api.github.com/users/mmd-osm","html_url":"https://github.com/mmd-osm","followers_url":"https://api.github.com/users/mmd-osm/followers","following_url":"https://api.github.com/users/mmd-osm/following{/other_user}","gists_url":"https://api.github.com/users/mmd-osm/gists{/gist_id}","starred_url":"https://api.github.com/users/mmd-osm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmd-osm/subscriptions","organizations_url":"https://api.github.com/users/mmd-osm/orgs","repos_url":"https://api.github.com/users/mmd-osm/repos","events_url":"https://api.github.com/users/mmd-osm/events{/privacy}","received_events_url":"https://api.github.com/users/mmd-osm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-13T18:53:23Z","updated_at":"2015-09-21T16:34:32Z","closed_at":null,"body":"This issue collects a few enhancement requests for statistics-based filters from various forum posts, e.g. [[1]](http://forum.openstreetmap.org/viewtopic.php?id=29856).\r\n\r\n* For `nodes`/`ways`/`relations`/`areas`: filter on the number of tags\r\n* For `ways`: filter on the number of (possibly distinct) nodes\r\n* For `nodes`: filter on the number of parent ways/relations\r\n* For `relations`: filter on the number of members / members with a specific role\r\n* For `relations`: filter on the total number of `relation`,`way` and `node` (and sum of those three object types) members.\r\n\r\nFor each \"number\", an exact value as well as a range (min.. max value) would be desirable.\r\n\r\nExamples (not an actual syntax proposal):\r\n```\r\nrel(membercount:0);        // relations without members (note: no lat/lon available, global search needed)\r\nway[highway](tagcount:1);  // way with single tag \"highway\"\r\nnode(parentwaycount:2..);  // nodes which occur in at least 2 ways \r\nway(nodecount:1);          // ways with a single node\r\n```\r\n\r\n_Update April 12th 2015:_\r\n\r\n@GeorgV suggested the following generalizations to keep the number of keywords low:\r\n\r\n(1) Change `parentwaycount` to `parentcount` - this would also allow to check in how many relations a way occurs. On the other hand, node(parentcount:2) might refer to a way or maybe even a relation, depending on the definition of a parent. I think this needs to be discussed in more detail.\r\n\r\n(2) Change `nodecount` to `membercount` - interpreting nodes of a way as members seems reasonable, unless we want to differentiate between rel(nodecount) and way(nodecount).\r\n\r\nAlso, Georg mentioned that we need to specify, if respective counts refer to *distinct numbers* or not. In the case of a closed way, we would e.g. determine a nodecount of 4, but a distinctnodecount of 3.\r\n\r\n@ all: if you have more ideas, please add them below. I will try to consolidate them later on.\r\n\r\nThis issue supersedes #180.\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/drolbr/Overpass-API/issues/comments/142036329","html_url":"https://github.com/drolbr/Overpass-API/issues/197#issuecomment-142036329","issue_url":"https://api.github.com/repos/drolbr/Overpass-API/issues/197","id":142036329,"user":{"login":"ImreSamu","id":2217320,"avatar_url":"https://avatars.githubusercontent.com/u/2217320?v=3","gravatar_id":"","url":"https://api.github.com/users/ImreSamu","html_url":"https://github.com/ImreSamu","followers_url":"https://api.github.com/users/ImreSamu/followers","following_url":"https://api.github.com/users/ImreSamu/following{/other_user}","gists_url":"https://api.github.com/users/ImreSamu/gists{/gist_id}","starred_url":"https://api.github.com/users/ImreSamu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ImreSamu/subscriptions","organizations_url":"https://api.github.com/users/ImreSamu/orgs","repos_url":"https://api.github.com/users/ImreSamu/repos","events_url":"https://api.github.com/users/ImreSamu/events{/privacy}","received_events_url":"https://api.github.com/users/ImreSamu/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T16:34:32Z","updated_at":"2015-09-21T16:34:32Z","body":"interesting problems : \r\n*   counting  \"name:*\" tags   on  all McDonalds ( http://www.openstreetmap.org/way/289752652 ) \r\n*   counting  \"addr:*\"   tags   \r\n*   counting  \"source:*\" tags\r\n*   counting  \"wheelchair:*\" tags  http://taginfo.openstreetmap.org/search?q=wheelchair%3A\r\n\r\nand filtering  + exporting the number to csv"}}