feat(expr-geo): add geometry kernels#1467
Draft
willcohen wants to merge 17 commits into
Draft
Conversation
…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.
willcohen
marked this pull request as draft
July 22, 2026 19:50
willcohen
force-pushed
the
kernels-geometry
branch
from
July 22, 2026 23:49
2044274 to
d9e17e1
Compare
…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.
willcohen
force-pushed
the
kernels-geometry
branch
from
July 23, 2026 00:04
d9e17e1 to
682df68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is another WIP PR (also draft: I will rebase after both
xyzm(#1462) andkernels-scalar(#1466) land, since it's stacked on both right now), adding the geometry-returning kernels togeoarrow-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.