Skip to content

Conversation

@joonaspessi
Copy link
Contributor

Did you read the Contributor Guide?

Yes, I have read the Contributor Rules and Contributor Development Guide

Is this PR related to a ticket?

Yes, and the PR name follows the format [SEDONA-XXX] my subject.

What changes were proposed in this PR?

Implement ST_OrientedEnvelope function by using JTS org.locationtech.jts.algorithm.MinimumAreaRectangle.getMinimumRectangle() function.

How was this patch tested?

  • Java, Scala and Python tests
  • Direct Pass through from JTS so not that much sense to go into corner cases

Did this PR include necessary documentation updates?

  • Yes, I am adding a new API. I am using the current SNAPSHOT version number in vX.Y.Z format.
  • Yes, I have updated the documentation.
  • No, this PR does not affect any public API so no need to change the documentation.

@github-actions github-actions bot added the docs label Dec 5, 2025
def ST_MinimumBoundingRadius(geometry: String): Column =
wrapExpression[ST_MinimumBoundingRadius](geometry)

def ST_OrientedEnvelope(geometry: Column): Column =
Copy link
Member

Choose a reason for hiding this comment

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

Please add a test for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additional tests added for scala



@validate_argument_types
def ST_OrientedEnvelope(geometry: ColumnOrName) -> Column:
Copy link
Member

Choose a reason for hiding this comment

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

please add a test for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additional tests added for python

return circle;
}

public static Geometry orientedEnvelope(Geometry geometry) {
Copy link
Member

Choose a reason for hiding this comment

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

do you mind also porting this to Flink and Snowflake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added Flink and Snowflake implementations

Copy link
Member

@jiayuasu jiayuasu left a comment

Choose a reason for hiding this comment

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

Thank you!

@jiayuasu jiayuasu merged commit 1909171 into apache:master Dec 7, 2025
41 checks passed
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