-
Notifications
You must be signed in to change notification settings - Fork 36
Add RS_WorldToRasterCoord variants #416
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
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 adds three new functions for converting world coordinates to raster pixel coordinates: RS_WorldToRasterCoordX, RS_WorldToRasterCoordY, and RS_WorldToRasterCoord. These functions perform the inverse affine transformation of the existing world coordinate functions.
Key Changes:
- Implements inverse affine transformation logic with determinant validation
- Adds three new UDFs for raster coordinate conversion
- Updates test infrastructure to support CRS in generated test rasters
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/sedona-raster/src/affine_transformation.rs | Adds to_raster_coordinate function implementing inverse affine transformation with tests |
| rust/sedona-raster-functions/src/rs_rastercoordinate.rs | New file implementing the three world-to-raster coordinate UDFs |
| rust/sedona-raster-functions/src/register.rs | Registers the new UDFs in the default function set |
| rust/sedona-raster-functions/src/lib.rs | Adds module declaration for rs_rastercoordinate |
| rust/sedona-testing/src/rasters.rs | Updates test raster generation to include CRS |
| rust/sedona-raster-functions/benches/native-raster-functions.rs | Adds benchmarks for the new functions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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!
Adding functions
RS_WorldToRasterCoordX,RS_WorldToRasterCoordY,RS_WorldToRasterCoord, with a provided x and y coordinate.Note that we should have another variant of these that accept a point, but it is out of scope for this PR.
Examples:
Benches: