dms_polygon_connectivity
Geometric functions dms_polygon_connectivity
syntax
- dms_polygon_connectivity(polygon_data_item)
- dms_polygon_connectivity(first_polygon_data_item, second_polygon_data_item)
description
dms_polygon_connectivity finds the pairs of polygons that overlap and returns them as a new uint32 Domain unit with a relation towards each polygon of a pair. It answers the same question as dms_overlay_polygon without computing the intersection geometry, and it does not even build one: use it when only the pairing is needed, and the overlay when the geometry or the Area of each overlap is needed too.
With one argument the pairs are those within a single set, each once, with first_rel < second_rel. With two arguments they run between two sets.
Unlike the four library variants, neither argument has to be a valid polygon: the pairs are decided by the even-odd reading of the dms polygon operators family. Two polygons form a pair when their intersection encloses an area; polygons that only touch are not a pair, as with bp_polygon_connectivity and unlike geos_polygon_connectivity.
result
The result is a new domain unit (uint32) with one entry per pair and two subitems:
first_rel: relation to the domain of the first (or only) argumentsecond_rel: relation to the domain of the second argument, or of the only argument in the one-argument form
Note the names: the unprefixed Polygon_connectivity and box_connectivity call their relations F1 and F2.
applies to
- Attribute arguments with a polygon Value type: spoint, ipoint, wpoint, upoint, fpoint or dpoint
conditions
- The composition type of the arguments needs to be polygon.
- The Values unit of the two arguments must match.
since version
20.20.0
example
unit<uint32> overlap := dms_polygon_connectivity(district/geometry)
{
attribute<district> first_rel;
attribute<district> second_rel;
}
see also
- dms_overlay_polygon - the same pairs, with the intersection geometry of each pair
- dms polygon operators - the family: the even-odd rule, the grid and what the result looks like
- geos_polygon_connectivity, bp_polygon_connectivity, bg_polygon_connectivity, cgal_polygon_connectivity - the same operator on the geometry libraries, which need valid operands
- Polygon_connectivity - the unprefixed operator, for integer coordinates, with relations F1 and F2
- box_connectivity - the cheap approximation on bounding boxes
- polygon operators - the comparison of the operators that find pairs of polygons