-
Notifications
You must be signed in to change notification settings - Fork 1
Polygon_connectivity
Geometric functions polygon_connectivity

- polygon_connectivity(polygon_data_item)
polygon_connectivity(polygon_data_item) results in a new uint32 domain unit with one entry for each 'connection' in the polygon_data_item argument.
Two polygons are connected when they overlap or touch: when they have a common interior point, share a boundary segment, or meet in a single boundary point. The operator is the connectivity extraction of the boost polygon library. To keep only the pairs that really overlap, intersect the two polygons of each pair and test the area, as the Spatial Overlap example does.
The function results in an F1 and F2 attribute with relations to the domain unit of the polygon_data_item attribute.
The relations indicate which connections exist, each connection only occurs once (a connection between polygon 0 and 1 only occurs as F1: 0 and F2: 1 and not vice versa).
Use the multiply operator for polygons to calculate the overlap between connected polygons.
The prefixed bp_polygon_connectivity, bg_polygon_connectivity, cgal_polygon_connectivity and geos_polygon_connectivity are a different implementation of the same idea, not a renaming of this operator: they also take two polygon sets, they name their relations first_rel and second_rel, and the bp_, bg_ and cgal_ ones require a common interior point, so a pair that only touches is not found there. Their xxx_overlay_polygon counterparts find the same pairs with the intersection geometry of each pair. The comparison is on polygon operators.
attribute polygon_data_item with an ipoint or spoint value type.
- The composition type type of the polygon_data_item argument needs to be polygon.
- The order of the points in polygon_data_item needs to be clockwise for exterior bounds and counter clockwise for holes in polygons (right-hand-rule).
7.135
O(n² * k) worst case where n = number of polygons and k = average polygon complexity. Uses spatial indexing to reduce comparisons in practice. Result size depends on connectivity of input polygons.
unit<uint32> connection := polygon_connectivity(district/geometry);
| F1 | F2 |
|---|---|
| 0 | 3 |
| 0 | 5 |
| 0 | 6 |
| 1 | 2 |
| 1 | 3 |
| 1 | 6 |
| 2 | 3 |
| 2 | 4 |
| 2 | 6 |
| 3 | 4 |
| 3 | 5 |
| 3 | 6 |
| 4 | 5 |
domain connection, nr of rows = 13
- bp_overlay_polygon, bg_overlay_polygon, cgal_overlay_polygon, geos_overlay_polygon - the pairs of two polygon sets, or of one set in the one-argument form, with the intersection geometry of each pair
- bp_polygon_connectivity, bg_polygon_connectivity, cgal_polygon_connectivity, geos_polygon_connectivity - the same pairs as those overlays find, as relations first_rel and second_rel only
- dms_polygon_connectivity and dms_overlay_polygon - the same two, on the sweep GeoDMS implements itself, which does not require valid operands
- box_connectivity - the cheap approximation on bounding boxes, with the same F1 and F2 layout
- triangualize - the same F1/F2 network shape, for the Delaunay neighbours of points
- polygon operators - the comparison of the operators that find pairs of polygons
- configuration examples: Border polygons, Spatial Overlap
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.