polygon operators
Back to Geometric functions
- Area - calculates the surface area of each polygon
- Centroid - center of mass of each polygon
- Centroid_or_mid - the centroid if located within the polygon, otherwise a mid-point
- Poly2grid - a grid representation of polygons
- poly2grid_untiled - a grid representation of polygons (untiled variant)
- poly2allgrids - a cross-table representation of polygons and raster cells
- poly2allgrids_uint64 - a uint64 cross-table representation of polygons and raster cells
- Lower_bound - the lowest X and Y values of the points in each polygon
- Upper_bound - the highest X and Y values of the points in each polygon
- Center_bound - the center X and Y values of the points in each polygon
- points2polygon - create polygons from sequences of points
- Sub (difference) - element-wise cutout of one polygon from another, where both domains match or one is void
- Mul (polygon intersection) - element-wise overlap of two polygon arrays, where both domains match or one is void
- Add (union) - element-wise union of two polygon arrays, where both domains match or one is void
- box_connectivity - find connected polygons based on bounding box overlap (faster, but less precise than Polygon_connectivity)
Operators based on the geos library (recommended: faster, reliable, supports float64/dpoint coordinates):
- geos_buffer_multi_polygon - creates a buffer polygon for each multi polygon
- geos_difference - element-wise difference of two polygon arrays (A minus B); also invoked by the
-operator for fpoint/dpoint coordinates - geos_intersect - element-wise intersection of two polygon arrays; also invoked by the
*and&operators for fpoint/dpoint coordinates - geos_overlay_polygon - spatial overlay between two polygon datasets, producing all intersecting pairs with their intersection geometry
- geos_polygon - clean and validate polygon geometry using GEOS
- geos_polygon_connectivity - find all pairs of adjacent or overlapping polygons
- geos_simplify_multi_polygon - simplify the geometry of a multi polygon
- geos_split_polygon - split multi-polygons into individual single-polygon parts, each as a separate domain entry
- geos_split_union_polygon - dissolve polygons (optionally grouped by attribute), then split into individual parts
- geos_union - element-wise union of two polygon arrays; also invoked by the
+and|operators for fpoint/dpoint coordinates - geos_union_polygon - dissolve all polygons into one, optionally grouped by a partition attribute
- geos_xor - element-wise symmetric difference of two polygon arrays; also invoked by the
^operator for fpoint/dpoint coordinates
To be developed operators:
- geos_simplify_single_polygon - simplify the geometry of a single polygon; see bg_simplify_multi_polygon
- geos_buffer_single_polygon - creates a buffer polygon for each single polygon; see Bg_buffer_multi_polygon
- geos_outer_single_polygon - selects only the outer ring of a single polygon; see bg_outer_multi_polygon
- geos_outer_multi_polygon - selects only the outer ring of a multi polygon; see bg_outer_multi_polygon
Operators based on the boost polygon library (usually slower than the _bg__-variants, and can only process integer coordinates):
- bp_buffer_multi_polygon - creates a buffer polygon around each multi polygon (integer coordinates)
- bp_difference - element-wise difference of two polygon arrays (integer coordinates)
- bp_intersect - element-wise intersection of two polygon arrays (integer coordinates)
- bp_overlay_polygon (or old syntax Overlay_polygon) - spatial overlay between two polygon datasets, producing all intersecting pairs (integer coordinates)
- bp_polygon - clean and validate polygon geometry using Boost Polygon (integer coordinates)
- bp_polygon_connectivity (or old syntax Polygon_connectivity) - find all pairs of adjacent or overlapping polygons (integer coordinates)
- bp_split_polygon (or old syntax Split_polygon) - split multi-polygons into individual single-polygon parts (integer coordinates)
- bp_split_union_polygon (or old syntax split_partitioned_union_polygon) - dissolve polygons (optionally grouped by attribute), then split into individual parts (integer coordinates). Combination of Split_polygon and partitioned_union_polygon
- bp_union - element-wise union of two polygon arrays (integer coordinates)
- bp_union_polygon (or old syntax Union_polygon (dissolve) or Partitioned_union_polygon (dissolve by attribute)) - dissolve all polygons into one, optionally grouped by a partition attribute (integer coordinates)
- bp_xor - element-wise symmetric difference of two polygon arrays (integer coordinates)
- Polygon inflated - increases each polygon by expanding its boundary outward
- Polygon deflated - decreases each polygon by contracting its boundary inward
Several boost polygon functions can be combined in a single operator; for the full list of those combinations, see here.
Operators based on the boost geometry library (float64/dpoint coordinates; largely superseded by their geos equivalents):
- Bg_buffer_multi_polygon - creates a buffer polygon for each multi polygon
- bg_buffer_single_polygon - creates a buffer polygon for each single polygon; see Bg_buffer_multi_polygon
- bg_difference - element-wise difference of two polygon arrays
- bg_intersect - element-wise intersection of two polygon arrays
- bg_outer_multi_polygon - selects only the outer ring of each multi polygon (removes holes)
- bg_outer_single_polygon - selects only the outer ring of each single polygon; see for documentation: bg_outer_multi_polygon
- bg_overlay_polygon - spatial overlay between two polygon datasets, producing all intersecting pairs
- bg_polygon - clean and validate polygon geometry using Boost Geometry
- bg_polygon_connectivity - find all pairs of adjacent or overlapping polygons
- bg_simplify_multi_polygon - simplify the geometry of a multi polygon
- bg_simplify_polygon - DEPRECATED: simplify the geometry of a single polygon; see for documentation: bg_simplify_multi_polygon
- bg_split_polygon - split multi-polygons into individual single-polygon parts
- bg_split_union_polygon - dissolve polygons (optionally grouped by attribute), then split into individual parts
- bg_union - element-wise union of two polygon arrays
- bg_union_polygon - DO NOT USE: current implementation does not produce reliable results
- bg_xor - element-wise symmetric difference of two polygon arrays
For examples, see here.
Operators based on the cgal library:
- cgal_difference - element-wise difference of two polygon arrays (CGAL)
- cgal_intersect - element-wise intersection of two polygon arrays (CGAL)
- cgal_overlay_polygon - spatial overlay between two polygon datasets, producing all intersecting pairs (CGAL)
- cgal_polygon - clean and validate polygon geometry using CGAL
- cgal_polygon_connectivity - find all pairs of adjacent or overlapping polygons (CGAL)
- cgal_split_polygon - split multi-polygons into individual single-polygon parts (CGAL)
- cgal_split_union_polygon - dissolve polygons (optionally grouped by attribute), then split into individual parts (CGAL)
- cgal_union - element-wise union of two polygon arrays (CGAL)
- cgal_union_polygon - dissolve all polygons into one, optionally grouped by a partition attribute (CGAL)
- cgal_xor - element-wise symmetric difference of two polygon arrays (CGAL)