bp_polygon_connectivity

Geometric functions > bp_polygon_connectivity

syntax

  • bp_polygon_connectivity(polygon_data_item)
  • bp_polygon_connectivity(first_polygon_data_item, second_polygon_data_item)

description

bp_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 bp_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, bp_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, bp_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 bp_ prefix of the function name indicates that the implementation of the operator uses the Boost Polygon library.

applies to

conditions

  1. The composition type of the arguments needs to be polygon.
  2. The Values unit of the two arguments must match.

This function results in problems for (integer) coordinates larger than 2^25 (after translation where the first point is moved to (0, 0)). If your integer coordinates, for instance, represent mm, 2^25[mm] = about 33 [km]. The reason is that for calculating intersections, products of coordinates are calculated and cast to float64 with a 53-bit mantissa. We advise you to keep the size of your integer coordinates for polygons limited.

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.6.0

example

unit<uint32> overlap := bp_polygon_connectivity(district/geometry)
{
    attribute<district> first_rel;
    attribute<district> second_rel;
}

see also