-
Notifications
You must be signed in to change notification settings - Fork 36
chore: Port georust/geo changes to sedona-geo-generic-alg #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…enerated TODO_GEO_COMMITS.txt
…nerated TODO_GEO_COMMITS.txt
…skip optimized intersects; mark PR #1377 SKIPPED
Renamed rectangle corner variables for clarity: - lt/rb (left-top/right-bottom) → lb/rt (left-bottom/right-top) - This makes variable names match their actual positions - lb = min (left-bottom), rt = max (right-top) Ported from georust/geo commits: - a83b4d50: Merge pull request #1368 - bbacf118: rename rectangle corners Tests: All 295 tests pass
…Rect v. Triangle
paleolimbot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ports optimization changes from georust/geo to sedona-geo-generic-alg, primarily focusing on improving the performance of intersection operations. The changes include algorithm optimizations, improved implementations for specific geometry type intersections, and updates to use more idiomatic constructors for empty geometries.
- Optimized polygon-polygon intersection logic to avoid redundant checks
- Added specialized intersection implementations for Triangle and Rect with Polygon
- Replaced verbose empty geometry constructors with concise
.empty()calls
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/sedona-geo-traits-ext/src/multi_polygon.rs | Expanded trait implementations by removing macro usage and explicitly defining polygon access methods |
| rust/sedona-geo-generic-alg/src/algorithm/map_coords.rs | Updated to use LineString::empty() instead of LineString::new(vec![]) |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/triangle.rs | Added optimized Triangle-Polygon and Triangle-Rect intersection implementations with tests |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/rect.rs | Added optimized Rect-Polygon intersection implementation and refactored Line intersection logic |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/polygon.rs | Refactored polygon-polygon intersection with optimized algorithm and removed delegated implementations |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/point.rs | Updated georust/geo source commit reference |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/mod.rs | Updated source reference and added missing test coverage for Coord intersections |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/line_string.rs | Added specialized LineString intersection implementations for Polygon, MultiPolygon, Rect, and Triangle |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/line.rs | Updated georust/geo source commit reference |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/coordinate.rs | Updated georust/geo source commit reference |
| rust/sedona-geo-generic-alg/src/algorithm/intersects/collections.rs | Updated georust/geo source commit reference |
| rust/sedona-geo-generic-alg/src/algorithm/dimensions.rs | Updated documentation examples to use .empty() constructor |
| rust/sedona-geo-generic-alg/src/algorithm/coordinate_position.rs | Updated test to use Polygon::empty() constructor |
| rust/sedona-geo-generic-alg/src/algorithm/centroid.rs | Updated tests to use .empty() constructors for MultiLineString and MultiPolygon |
| rust/sedona-geo-generic-alg/benches/intersection.rs | Added new benchmark cases for various intersection scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ported changes are mostly for optimizing intersects:
emptyconstructor to other crates. georust/geo#1364We observed performance improvements after applying these patches. Now the performance of sedona-geo-generic-alg's intersects function is on par with the upstream georust/geo:
Distance computation uses intersects internally, so the performance of distance computation should be improved theoretically. However, I have not observed performance improvements by running the distance bench, probably because it only involves simple shapes.