Skip to content

feat(expr-geo): add geometry kernels#1467

Draft
willcohen wants to merge 17 commits into
geoarrow:mainfrom
willcohen:kernels-geometry
Draft

feat(expr-geo): add geometry kernels#1467
willcohen wants to merge 17 commits into
geoarrow:mainfrom
willcohen:kernels-geometry

Conversation

@willcohen

@willcohen willcohen commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This is another WIP PR (also draft: I will rebase after both xyzm (#1462) and kernels-scalar (#1466) land, since it's stacked on both right now), adding the geometry-returning kernels to geoarrow-expr-geo: boolean ops, bounding-rect, affine, densify, chaikin smoothing, concave-hull, center, closest-point, and line-interpolate-point. Each returns a new GeoArrow geometry array.

…ged; root + python; drop on geo 0.34 release)
simplify, simplifyVw, simplifyVwPreserve, and convexHull now preserve
Z/M instead of dropping to XY: coords that survive geo's index-returning
APIs (georust/geo#1538) are looked up full-dim and pushed through
GeometryBuilder's typed push_* paths. The three simplify ops collapse
into one selector-driven implementation (simplify_shared); the geo
parity details (closed-ring index mapping, epsilon guards, per-ring
minimums) are documented at the code sites they apply to.

Breaking: convex_hull returns Arc<dyn GeoArrowArray> instead of
PolygonArray, so heterogeneous Geometry inputs keep per-row dims; typed
inputs still produce a PolygonArray.

Widens GeometryBuilder's typed push_* methods to pub (raw-offset
methods stay pub(crate)). Bumps geo-types 0.7.16 -> 0.7.19.
@github-actions github-actions Bot added the feat label Jul 22, 2026
@willcohen
willcohen marked this pull request as draft July 22, 2026 19:50
willcohen added 15 commits July 22, 2026 19:55
…ch-all coverage, tidy docs

Ensure validity of the xyzm tests through mutation testing. No
implementation change.

- Drop simplify_vw_xyzm_linestring_preserves_zm: at eps 0 simplify_vw
  copies, so it's a subset of the zero-epsilon test.
- Fix convex_hull_xyzm_geometry_array_preserves_zm: its Z/M oracle read
  through the impl, masking a drop; now reads collect_geom_coords.
- Add simplify_vw_keeps_points_rdp_would_drop: a VW->RDP swap passed every
  prior test; the new fixture keeps 5 vertices under VW, 3 under RDP.
- Rewrite simplify_vw's geometry-array test at eps>0: the catch-all's
  per-type simplification was untested.
- Fill out the four pub-fn docstrings; drop a duplicated test comment.
Four public fns intersection/union/difference/xor, each delegating to one
private _boolean_op over _boolean_op_impl (mirrors area.rs's shared-impl
style; binary two-array dispatch via downcast_geoarrow_array_two_args! like
intersects.rs). Element-wise left[i] op right[i]; errors on length mismatch.

geo::BooleanOps is areal-only, so per element a non-Polygon/MultiPolygon
input pushes null (documented); null in either side -> null out. Output is a
concrete 2D MultiPolygonArray; Z/M dropped as in buffer. xor follows geo's
method name (symmetric difference).

Tests: two overlapping unit squares -> intersection/union/difference/xor
areas; null + non-areal propagation; length-mismatch error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant