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) argument
  • second_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

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