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

  1. The composition type of the arguments needs to be polygon.
  2. 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) argument
  • second_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