Skip to content

Add RS_Rotation#418

Merged
paleolimbot merged 9 commits into
apache:mainfrom
jesspav:rs_rotation
Dec 11, 2025
Merged

Add RS_Rotation#418
paleolimbot merged 9 commits into
apache:mainfrom
jesspav:rs_rotation

Conversation

@jesspav

@jesspav jesspav commented Dec 5, 2025

Copy link
Copy Markdown
Collaborator

Adding function RS_Rotation

Example:

> select rs_rotation(RS_Example());
┌───────────────────────────┐
│ rs_rotation(rs_example()) │
│          float64          │
╞═══════════════════════════╡
│        0.4636476090008061 │
└───────────────────────────┘

Bench:

native-raster-rs_rotation-Array(Raster(64, 64))
                        time:   [795.28 µs 796.17 µs 797.00 µs]

@jesspav jesspav requested a review from Copilot December 5, 2025 21:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 a new RS_Rotation function that calculates the rotation angle (in radians) of a raster based on its geotransform metadata. The rotation is computed using atan2(skew_y, scale_x).

Key changes:

  • Implements core rotation() function in the affine transformation module
  • Adds RS_Rotation UDF with corresponding documentation
  • Includes comprehensive unit tests covering multiple rotation angles (0°, 45°, 60°, 90°, 180°)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
rust/sedona-raster/src/affine_transformation.rs Adds rotation() function and comprehensive test cases
rust/sedona-raster-functions/src/rs_geotransform.rs Implements RS_Rotation UDF with documentation and test coverage
rust/sedona-raster-functions/src/register.rs Registers the new rs_rotation_udf function
rust/sedona-raster-functions/benches/native-raster-functions.rs Adds benchmark for rs_rotation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jesspav jesspav marked this pull request as ready for review December 10, 2025 17:56
@jesspav jesspav requested a review from paleolimbot December 11, 2025 14:58

@paleolimbot paleolimbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@paleolimbot paleolimbot merged commit 45b3162 into apache:main Dec 11, 2025
14 checks passed
@paleolimbot paleolimbot added this to the 0.3.0 milestone Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants