Hey, you can I ask Overpass to just give me back Objects with just one particular tag and no other tags. e.g. if a object has the tag building=yes it should be displayed if it has building=yes and addr:city=whatever it shouldn't? How can i make that happen ? Thanks for your answers! asked 03 Jun '13, 20:05 hno2 |
http://overpass-turbo.eu/s/rjM has an example of query that is using tag counting. It will find poorly tagged object - with only tourism=attraction or tourism attraction + name tag in Poland,
query was provided by RicoElectrico, thanks! source: https://forum.openstreetmap.org/viewtopic.php?pid=661266#p661266 answered 29 Aug '17, 08:58 Mateusz Koni... |
I don't know if overpass API can count tags. Neither do I know if you can query "your" objects. If you are looking for buildings wighout house numbers, you could either use Simon's no address layer or you could use this overpass query (objects that have a building tag set and don't have an addr:housenumber tag):
HTH /al answered 04 Jun '13, 13:21 _al 1
Thanks, I was looking for a query to find ways with addr:interpolation but without addr:street
(10 Oct '13, 20:17)
cyph3r
1
Overpass API cannot count tags yet. There's an open issue for that on Github: https://github.com/drolbr/Overpass-API/issues/197
(22 Mar '15, 17:07)
mmd
|
A combination of the difference operator and regular expressions for keys can make this happen. Unfortunately, you cannot use negative look-ahead (?!) for regular expressions, which makes the whole story very complex (see this stackoverflow post on how to build such an expression). That's why I resort to a simplified approach and exclude buildings, which have any tags that don't start with a letter "b". However, the basic principle is the same.
Try in Overpass Turbo: http://overpass-turbo.eu/s/4Z9 answered 10 Sep '14, 09:02 mmd |
I'm not sure what you mean. Concerning the output format, Overpass API prints for an object always either all tags or no tags at all. If you want to find an object with a certain tag but not a certain other tag, you can the solution provided by _al above. answered 05 Jun '13, 07:34 Roland Olbricht 2
As far as I understand he is looking for a solution to find objects which only have one tag - the specified tag - and no other tags at all.
(05 Jun '13, 08:14)
scai ♦
1
Thats right, e.g a node with the tag addr:street: Obama Alley and without any other tags should be printed a node with addr:street and addr:country not. But I already solved my problem with an other possible solution
(05 Jun '13, 16:45)
hno2
|
Update September 2014: Now that Overpass API also supports regular expressions for keys, this kind of query is now possible. See my answer below for details.