Contribute to project

LearnOverpass

Difference Improve page

The difference block statement is written as a pair of parentheses. Inside the difference statement, exactly two statements must be placed, and between them a minus sign.

It takes no input set. It produces a result set. Its result set contains all elements that are result of the first sub-statement and not contained in the result of the second sub-statement.

Example:

This collects all nodes that have a name tag “Foo” but are not inside the given bounding box.

The result set of the difference statement can be redirected with the usual postfix notation:

Example:

Same as the preceding example, but the result is written into the variable a.

Data