Geometric difference
This topic describes how to use the geometric difference operator.
Usage
The geometric difference operator calculates the spatial difference of a primary table relative to an associated node (another data table).
Scenarios
Compute Link | Compute engine | Supported |
Offline | PostgreSQL | Yes |
Polar_PG | Yes | |
AnalyticDB PostgreSQL(ADB_PG) | Yes |
Instructions
Source nodes
The geometric difference operator requires two source nodes, also called input nodes. Each source node represents a data table and must contain at least one geometry field. The operator uses these fields to calculate the spatial difference between the two tables. If a data table contains multiple geometry fields, the operator selects the first geometry field by default. You can manually switch to other geometry fields.
Primary table
One of the input nodes is designated as the primary table. By default, the first input node is set as the primary table. You can manually set the other node as the primary table. The result of the geometric difference contains the records from the primary table that are outside the spatial area of the associated node.
Difference area threshold
The difference area is the spatial area of the primary table's geometry minus the area where it intersects with the associated node's spatial range. If you do not set a difference area threshold, the operator returns the records from the primary table that are outside the spatial area of the associated node. If you set a threshold, the operator returns only the records where the difference area is greater than or equal to the specified threshold.
Output fields
You can configure the list of fields that the current node outputs to descendant nodes. By default, the output includes a geometry field for the difference result (field name `difference_result`) and all fields from the primary table. You can remove or rename the fields from the primary table as needed.