geos_xor
Geometric functions > geos_xor
syntax
- geos_xor(polygon_data_item1, polygon_data_item2)
description
geos_xor(polygon_data_item1, polygon_data_item2) results in a data item with the symmetric difference of the two polygon arguments. The result contains, for each element, the area covered by exactly one of the two polygon arguments (i.e., the union minus the intersection).
The operator is applied element-by-element. Both domains need to match, or one of the arguments needs to be a parameter (void domain).
The geos_ prefix of the function name indicates that the implementation of the operator uses geos.
This operator is also automatically invoked by the ^ operator when used with fpoint or dpoint polygon data items.
applies to
- attribute polygon_data_item1 with a polygon value type
- attribute polygon_data_item2 with a polygon value type
The value types of both arguments must be compatible (same point type).
conditions
- The composition type of both arguments needs to be polygon.
- The domains of the two arguments must match, or one argument must have a void domain (parameter).
since version
14.0
example
attribute<fpoint> geometry_xor (district) := geos_xor(geometry_A, geometry_B);
// equivalent to:
attribute<fpoint> geometry_xor (district) := geometry_A ^ geometry_B;