bg_polygon_connectivity
Geometric functions > bg_polygon_connectivity
syntax
- bg_polygon_connectivity(polygon_data_item)
- bg_polygon_connectivity(first_polygon_data_item, second_polygon_data_item)
description
bg_polygon_connectivity finds the pairs of polygons that overlap and returns them as a new Domain unit with a relation towards each polygon of a pair. It answers the same question as bg_overlay_polygon without computing the intersection geometry: 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, bg_polygon_connectivity(polygon_data_item) finds the pairs within one polygon set. Each pair occurs once, with first_rel < second_rel, and a polygon is never paired with itself. Since GeoDMS 15.7.0.
With two arguments, bg_polygon_connectivity(first_polygon_data_item, second_polygon_data_item) finds the pairs between two polygon sets: each polygon of the first set with each polygon of the second set that it overlaps.
Two polygons form a pair when their intersection has an area, that is when they have a common interior point. Polygons that only touch, along a shared edge or at a single point, are not a pair. This differs from Polygon_connectivity, which pairs touching polygons too, and from geos_polygon_connectivity.
The bg_ prefix of the function name indicates that the implementation of the operator uses boost geometry.
applies to
- attribute polygon_data_item, first_polygon_data_item and second_polygon_data_item with a polygon value type
conditions
- The composition type of the arguments needs to be polygon.
- The Values unit of the two arguments must match.
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
A relation is absent when its argument is a Parameter (a Void domain). Note the names: the unprefixed Polygon_connectivity and box_connectivity call their relations F1 and F2.
since version
15.7.0
example
unit<uint32> overlap := bg_polygon_connectivity(district/geometry)
{
attribute<district> first_rel;
attribute<district> second_rel;
}
see also
- bg_overlay_polygon - the same pairs, with the intersection geometry of each pair
- Polygon_connectivity - the unprefixed operator, for integer coordinates: touching polygons count too, and its relations are named F1 and F2
- box_connectivity - the cheap approximation on bounding boxes
- geos_polygon_connectivity, cgal_polygon_connectivity, bp_polygon_connectivity - the same operator on the other geometry libraries
- polygon operators - the comparison of the operators that find pairs of polygons
- dms_polygon_connectivity - the same operator on the sweep GeoDMS implements itself, which accepts operands that are not valid polygons