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.
xxxxxxxxxx
(statement_1; - statement_2;)[->.result_set];
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:
xxxxxxxxxx
(node[name="Foo"]; - node(50.0,7.0,51.0,8.0););
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:
xxxxxxxxxx
(node[name="Foo"]; - node(50.0,7.0,51.0,8.0);)->.a;
Same as the preceding example, but the result is written into the variable a.
xxxxxxxxxx
1
(
2
node[amenity]( 47.06, 15.435, 47.07, 15.44);
3
-node[amenity](47.064, 15.435, 47.066, 15.44);
4
);
5
out;
6