Skip to content

feat(expr-geo)!: XYZM passthrough for simplify and convex_hull ops - #1462

Open
willcohen wants to merge 5 commits into
geoarrow:mainfrom
willcohen:xyzm
Open

feat(expr-geo)!: XYZM passthrough for simplify and convex_hull ops#1462
willcohen wants to merge 5 commits into
geoarrow:mainfrom
willcohen:xyzm

Conversation

@willcohen

@willcohen willcohen commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Preserves Z and M through the simplify family (simplify, simplify_vw,
simplify_vw_preserve) and convex_hull; previously these dropped to XY.

Breaking: convex_hull returns Arc<dyn GeoArrowArray> instead of
PolygonArray, since each row's hull can carry a different dimension.

Needs the index APIs from georust/geo#1538 (merged, unreleased), so geo is
pinned to a rev of geo main until geo 0.34; geo-types/geo-traits now come
from crates.io (geo-types 0.7.16 → 0.7.20). When geo cuts a new release, this
can replace the git rev with the release on crates.io.

@github-actions github-actions Bot added the feat label Jul 10, 2026
@willcohen

Copy link
Copy Markdown
Contributor Author

That patch isn't working. Need to rework to go off branch for WIP.

@willcohen
willcohen marked this pull request as draft July 10, 2026 19:01
@willcohen

Copy link
Copy Markdown
Contributor Author

I don't think I'm going to get CI to be able to run off of an unmerged branch for geo, but this would still be useful to get a first set of review on! (the tests pass locally)

@kylebarron

Copy link
Copy Markdown
Member

I think you need to check cargo.lock to see if there are multiple versions of geo still.

Or, in particular, it looks like you correctly pinned the top-level Cargo.toml, because the rust CI is succeeding. But you didn't pin the python/Cargo.toml, because Python jobs are failing. They're separate projects because of some pyo3-specific behavior.

@willcohen
willcohen force-pushed the xyzm branch 2 times, most recently from c8a1b2b to 6cc78af Compare July 13, 2026 20:26
@willcohen

Copy link
Copy Markdown
Contributor Author

Still a draft pending the upstream PR to georust/geo. Thank you @kylebarron for helping me navigate CI.

@willcohen
willcohen force-pushed the xyzm branch 2 times, most recently from 40160d8 to ac7722f Compare July 21, 2026 20:30
@willcohen willcohen changed the title feat(geoarrow-expr-geo): XYZM passthrough for simplify and convex_hull ops feat(expr-geo): XYZM passthrough for simplify and convex_hull ops Jul 21, 2026
@willcohen
willcohen force-pushed the xyzm branch 2 times, most recently from 54574cf to 2e3a99e Compare July 21, 2026 20:45
@willcohen

Copy link
Copy Markdown
Contributor Author

Sorry for the churn. I'm still getting the hang of clippy (it's teaching me a lot, just not invoking it locally the right way to line up with CI) and rust release cadence.

Reworked now that georust/geo#1538 has merged: the pin targets an exact rev of geo main, rebased to main, and simplify_vw_preserve now shares one traversal with the other two simplify ops. Also dealt with a few edge cases (unclosed rings, polygon RDP's 4-coord ring minimum, vw at epsilon <= 0), each with a regression test.

I think this is ready for review.

@willcohen
willcohen marked this pull request as ready for review July 21, 2026 20:49
@willcohen

Copy link
Copy Markdown
Contributor Author

One more change: simplify_vw still got unclosed rings wrong (the last vertex could never drop and the ring came back unclosed). All now use the same closed-ring path. There's a test for that and just some cleanup in the last force push.

Comment thread python/Cargo.toml Outdated
Comment thread rust/geoarrow-array/src/builder/geometry.rs Outdated
Comment thread Cargo.toml Outdated
Comment thread rust/geoarrow-expr-geo/src/lib.rs Outdated
Comment thread rust/geoarrow-expr-geo/src/index_wrappers.rs Outdated
@kylebarron

Copy link
Copy Markdown
Member

^ Just a quick review; I haven't made it through the entire PR yet. Some of the (seemingly) clauded code is pretty verbose 😕

@willcohen

willcohen commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

I’ll give this a better rework today on de-verbosity. These comments are very helpful. I still dont have a good spidey sense of when Claude is going full Claude on Rust versus what is idiomatic. I’ll move this back to draft.

Would you prefer an additional commit on this branch or a cleaned up squash and force push?
edit: I see that it all gets squashed -- once I get this cleaned up I'll just add addl commits.

@willcohen
willcohen marked this pull request as draft July 23, 2026 11:23
@willcohen

Copy link
Copy Markdown
Contributor Author

Ok. The insane number of tests is way slimmed down. I'm still not sure the traits are implemented the right way. If you'd like me to consolidate this back into a smaller number of commits, let me know.

@willcohen

Copy link
Copy Markdown
Contributor Author

Branch reworked and force pushed (each commit now consolidates the changes into single tasks, and isolated the file moves for simplify into their own commit). The actual implementation itself is unchanged from what you last reviewed. Comments are limited now to noting a few quirks relative to geo and the reason for a rustfmt skip. The amount of testing is still a little more intense than otherwise present in the crate, but since this PR is now creating a mechanism to carry coordinates alongside geo, that makes sense to me. Happy to slim the testing apparatus back further, though, if that feels unnecessary.

@willcohen
willcohen marked this pull request as ready for review July 24, 2026 16:09
@willcohen

Copy link
Copy Markdown
Contributor Author

More cleanup since your review: simpler test assertions, no unsafe blocks left, dim_geom down to four trait types, and the rustfmt::skip is gone. With that, the PR has dropped from 1444 -> 1208 additions.

@willcohen

Copy link
Copy Markdown
Contributor Author

Since it's been a while, I squashed the post-review edits into the commits they amended so it's cleaner to re-review each commit -- the branch is five commits again. I also trimmed down the pin in the first commit down, now that geo-types 0.7.20 is out: geo-types/geo-traits come from crates.io again. geo itself still uses a git rev pending the next release they make.

@willcohen
willcohen requested a review from kylebarron August 19, 2026 23:18
@willcohen willcohen changed the title feat(expr-geo): XYZM passthrough for simplify and convex_hull ops feat(expr-geo)!: XYZM passthrough for simplify and convex_hull ops Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants