[OSM-talk] Overpass API 0.7.4: the difference operator

Roland Olbricht roland.olbricht at gmx.de
Fri Aug 2 16:15:40 UTC 2013

Dear Co-mappers,

The new release 0.7.4 of Overpass API has just been deployed on
The Rambler instance will continue to run version 0.7.3 for some days in case 
of unexpected flaws in the new version. A lot of minor bugs have been fixed. 
More important, the query for ways on small bounding boxes is now more 
efficient. This speeds up
the beta prototype for a popup overlay on the main page.

I've also made two extensions in the syntax: The use of Global Bounding Boxes 
will be subject of a later mail to talk@ when the newest version of the JOSM 
plugin mirrored_download has been deployed.

Now I talk about the difference operator: It simplifies the kind of searches 
"every object that has property (or is an) X, but hasn't property (or is an) 
Y". For example, all nodes that have a value for "maxheight" but aren't part 
of a street (a way with tag "highway"):


// New in Overpass 0.7.4: the difference operator

  node[maxheight];     // All nodes witha value for "maxheight"
  (way[highway];>;);   // that aren't part of any kind of street

For the very common case "has tag X, but not tag Y" I suggest to carry on with 
"[...!~...]". This is more efficient than the difference operator:


// New in Overpass 0.7.4: the difference operator
// If the negation only covers that a certain tag is absent, you may prefer
// the tag negation operator. This operator is faster than difference.

( way[highway=residential][name!~'.'];  // ways with tag "highway", but 
without tag "name"

All details are given in the wiki:



More information about the talk mailing list