dms_convex_polygon_connectivity

Geometric functions dms_convex_polygon_connectivity

dms_convex_polygon_connectivity finds the pairs of convex polygons that overlap, in the same forms as dms_polygon_connectivity, with every polygon a single convex ring as premise.

syntax

  • dms_convex_polygon_connectivity(polygon_data_item)
  • dms_convex_polygon_connectivity(first_polygon_data_item, second_polygon_data_item)
  • dms_convex_polygon_connectivity(polygon_data_item, group)
  • dms_convex_polygon_connectivity(first_polygon_data_item, second_polygon_data_item, first_group, second_group)

description

Since GeoDMS 20.24.0.

The result and the four forms are those of dms_polygon_connectivity:

  • a new uint32 Domain unit with one entry per pair, and the subitems first_rel and second_rel;
  • with one set, each pair once and forward;
  • with groups, no pair within one group and one pair per pair of groups.

What differs is how a pair is decided. Two convex polygons overlap with a positive area exactly when no edge of either one has all of the other on its outer side or on it, so each candidate pair is decided by testing those edges, instead of by the sweep of the dms polygon operators. Polygons that only touch are not a pair, as with dms_polygon_connectivity.

Finding the candidate pairs costs the same in both operators, and it takes most of the time. On the convex parts of building outlines and of CBS buurten, grown with [[dms_minkowski_sum]], this operator took 5 to 20% less time than dms_polygon_connectivity in the grouped form.

The test is exact: on integer coordinates by exact products, on floating point coordinates by exact predicates. It does not round to the grid of the dms_ family. A pair whose overlap is thinner than a grid cell is therefore a pair here, while dms_polygon_connectivity can round it away. On 57,290 building outlines, grown by 1 m and split into convex parts, that was the case for 3 of the 32,506 pairs of buildings: slivers of 19 to 41 mm².

The premise is the caller’s. The operator does not check that a polygon is one convex ring, and a polygon that is not, gives wrong pairs. The parts of dms_split_convex_polygon and dms_split_convex_polygon_keilsnoeyink meet the premise, and so do their [[dms_minkowski_sum]] with a convex kernel.

applies to

  • Attribute arguments with a polygon Value type: spoint, ipoint, wpoint, upoint, fpoint or dpoint

conditions

  1. The composition type of the polygon arguments needs to be polygon, and every polygon a single convex ring.
  2. The Values unit of the two polygon arguments must match.
  3. In the grouped forms, each group has the Domain unit of its polygon argument, the groups are uint32, and in the four-argument form their values units must match.

since version

20.24.0

example

Which buildings overlap once grown by 1 m, through the convex parts of each building:

unit<uint32>   parts := dms_split_convex_polygon(pand/geometry);
attribute<rdc> grown (parts, polygon) := dms_minkowski_sum(parts/geometry, 1.0, '8D');
unit<uint32>   pairs := dms_convex_polygon_connectivity(grown, parts/polygon_rel)
{
    attribute<pand> pand1 := parts/polygon_rel[first_rel];
    attribute<pand> pand2 := parts/polygon_rel[second_rel];
}

see also