You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "joonaspessi (via GitHub)" <gi...@apache.org> on 2025/12/05 04:30:14 UTC

[PR] [GH-2552] Add ST_OrientedEnvelope [sedona]

joonaspessi opened a new pull request, #2553:
URL: https://github.com/apache/sedona/pull/2553

   ## Did you read the Contributor Guide?
   
   Yes, I have read the [Contributor Rules](https://sedona.apache.org/latest/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest/community/develop/)
   
   ## 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](https://github.com/apache/sedona/blob/99239524f17389fc4ae9548ea88756f8ea538bb9/pom.xml#L29) 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GH-2552] Add ST_OrientedEnvelope [sedona]

Posted by "joonaspessi (via GitHub)" <gi...@apache.org>.
joonaspessi commented on code in PR #2553:
URL: https://github.com/apache/sedona/pull/2553#discussion_r2594879508


##########
python/sedona/spark/sql/st_functions.py:
##########
@@ -1595,6 +1595,18 @@ def ST_NumInteriorRing(geometry: ColumnOrName) -> Column:
     return _call_st_function("ST_NumInteriorRing", geometry)
 
 
+@validate_argument_types
+def ST_OrientedEnvelope(geometry: ColumnOrName) -> Column:

Review Comment:
   Additional tests added for python



##########
spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/st_functions.scala:
##########
@@ -504,6 +504,11 @@ object st_functions {
   def ST_MinimumBoundingRadius(geometry: String): Column =
     wrapExpression[ST_MinimumBoundingRadius](geometry)
 
+  def ST_OrientedEnvelope(geometry: Column): Column =

Review Comment:
   Additional tests added for scala



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GH-2552] Add ST_OrientedEnvelope [sedona]

Posted by "joonaspessi (via GitHub)" <gi...@apache.org>.
joonaspessi commented on code in PR #2553:
URL: https://github.com/apache/sedona/pull/2553#discussion_r2594879659


##########
common/src/main/java/org/apache/sedona/common/Functions.java:
##########
@@ -1227,6 +1228,10 @@ public static Geometry minimumBoundingCircle(Geometry geometry, int quadrantSegm
     return circle;
   }
 
+  public static Geometry orientedEnvelope(Geometry geometry) {

Review Comment:
   Added Flink and Snowflake implementations



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GH-2552] Add ST_OrientedEnvelope [sedona]

Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #2553:
URL: https://github.com/apache/sedona/pull/2553


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GH-2552] Add ST_OrientedEnvelope [sedona]

Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu commented on code in PR #2553:
URL: https://github.com/apache/sedona/pull/2553#discussion_r2594523625


##########
docs/api/sql/Function.md:
##########
@@ -3490,6 +3490,26 @@ Output:
 3
 ```
 
+## ST_OrientedEnvelope
+
+Introduction: Returns the minimum-area rotated rectangle enclosing a geometry. The rectangle may be rotated relative to the coordinate axes. Degenerate inputs may result in a Point or LineString being returned.
+
+Format: `ST_OrientedEnvelope(geom: Geometry)`
+
+Since: `v1.8.x`

Review Comment:
   ```suggestion
   Since: `v1.8.1`
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GH-2552] Add ST_OrientedEnvelope [sedona]

Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu commented on code in PR #2553:
URL: https://github.com/apache/sedona/pull/2553#discussion_r2594523940


##########
spark/common/src/main/scala/org/apache/spark/sql/sedona_sql/expressions/st_functions.scala:
##########
@@ -504,6 +504,11 @@ object st_functions {
   def ST_MinimumBoundingRadius(geometry: String): Column =
     wrapExpression[ST_MinimumBoundingRadius](geometry)
 
+  def ST_OrientedEnvelope(geometry: Column): Column =

Review Comment:
   Please add a test for this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [GH-2552] Add ST_OrientedEnvelope [sedona]

Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu commented on code in PR #2553:
URL: https://github.com/apache/sedona/pull/2553#discussion_r2594524289


##########
common/src/main/java/org/apache/sedona/common/Functions.java:
##########
@@ -1227,6 +1228,10 @@ public static Geometry minimumBoundingCircle(Geometry geometry, int quadrantSegm
     return circle;
   }
 
+  public static Geometry orientedEnvelope(Geometry geometry) {

Review Comment:
   do you mind also porting this to Flink and Snowflake?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org