You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sedona.apache.org by "iGN5117 (via GitHub)" <gi...@apache.org> on 2023/06/20 04:48:24 UTC

[GitHub] [sedona] iGN5117 opened a new pull request, #863: [SEDONA-213] Add ST_BoundingDiagonal

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

   
   ## Did you read the Contributor Guide?
   
   - Yes, I have read [Contributor Rules](https://sedona.apache.org/latest-snapshot/community/rule/) and [Contributor Development Guide](https://sedona.apache.org/latest-snapshot/community/develop/)
   
   ## Is this PR related to a JIRA ticket?
   
   - Yes, the URL of the associated JIRA ticket is https://issues.apache.org/jira/browse/SEDONA-213. The PR name follows the format `[SEDONA-XXX] my subject`.
   
   
   ## What changes were proposed in this PR?
   - Add ST_BoundingDiagonal to Sedona
   
   
   ## How was this patch tested?
   - Comprehensive correctness test cases in java
   - Integration test cases in Spark and Flink
   
   
   ## Did this PR include necessary documentation updates?
   
   - Yes, I am adding a new API. I am using the [1.4.1](https://github.com/apache/sedona/blob/master/pom.xml#L29) in since `vX.Y.Z` format.
   
   


-- 
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: dev-unsubscribe@sedona.apache.org

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


[GitHub] [sedona] iGN5117 commented on pull request #863: [SEDONA-213] Add ST_BoundingDiagonal

Posted by "iGN5117 (via GitHub)" <gi...@apache.org>.
iGN5117 commented on PR #863:
URL: https://github.com/apache/sedona/pull/863#issuecomment-1599650116

   > And, as Kristin is gonna cut the 1.4.1 release today, this new API will be published in Sedona 1.5.0. Please update the version num in this PR accordingly. I will merge this PR after Kristin cuts the release.
   
    --Noted, I have updated the documentation to reflect 1.5.0 availability


-- 
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: dev-unsubscribe@sedona.apache.org

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


[GitHub] [sedona] iGN5117 commented on a diff in pull request #863: [SEDONA-213] Add ST_BoundingDiagonal

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


##########
sql/common/src/main/scala/org/apache/sedona/sql/UDF/Catalog.scala:
##########
@@ -178,14 +179,10 @@ object Catalog {
     function[RS_Array](),
     function[RS_Normalize](),
     function[RS_Append](),
-    function[RS_AddBandFromArray](),

Review Comment:
   This was an accident while merging with master.
   I have reverted 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: dev-unsubscribe@sedona.apache.org

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


[GitHub] [sedona] iGN5117 commented on a diff in pull request #863: [SEDONA-213] Add ST_BoundingDiagonal

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


##########
common/src/main/java/org/apache/sedona/common/Functions.java:
##########
@@ -931,4 +931,34 @@ public static Geometry geometricMedian(Geometry geometry) throws Exception {
         return geometricMedian(geometry, DEFAULT_TOLERANCE, DEFAULT_MAX_ITER, false);
     }
 
+    public static Geometry boundingDiagonal(Geometry geometry) {
+        if (geometry.isEmpty()) {
+            return GEOMETRY_FACTORY.createLineString();
+        }else {
+            Envelope envelope = geometry.getEnvelopeInternal();

Review Comment:
   Good point, I started out with that initially but ended up using envelope for simplicity. I did not take into account its internal implementation.
   Reverted to using 1 loop



-- 
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: dev-unsubscribe@sedona.apache.org

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


[GitHub] [sedona] jiayuasu commented on a diff in pull request #863: [SEDONA-213] Add ST_BoundingDiagonal

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


##########
common/src/main/java/org/apache/sedona/common/Functions.java:
##########
@@ -931,4 +931,34 @@ public static Geometry geometricMedian(Geometry geometry) throws Exception {
         return geometricMedian(geometry, DEFAULT_TOLERANCE, DEFAULT_MAX_ITER, false);
     }
 
+    public static Geometry boundingDiagonal(Geometry geometry) {
+        if (geometry.isEmpty()) {
+            return GEOMETRY_FACTORY.createLineString();
+        }else {
+            Envelope envelope = geometry.getEnvelopeInternal();

Review Comment:
   getEnvelopeInternal() also traverses all coordinates I guess. Why not just have a single loop and traverse all coordinates?



##########
sql/common/src/main/scala/org/apache/sedona/sql/UDF/Catalog.scala:
##########
@@ -178,14 +179,10 @@ object Catalog {
     function[RS_Array](),
     function[RS_Normalize](),
     function[RS_Append](),
-    function[RS_AddBandFromArray](),

Review Comment:
   Why remove other functions?



-- 
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: dev-unsubscribe@sedona.apache.org

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


[GitHub] [sedona] iGN5117 commented on a diff in pull request #863: [SEDONA-213] Add ST_BoundingDiagonal

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


##########
common/src/test/java/org/apache/sedona/common/FunctionsTest.java:
##########
@@ -15,6 +15,7 @@
 
 import com.google.common.geometry.S2CellId;
 import com.google.common.math.DoubleMath;
+import com.sun.org.apache.xpath.internal.operations.Mult;

Review Comment:
   This must've been added automatically due to a mistype, removed it.



-- 
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: dev-unsubscribe@sedona.apache.org

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


[GitHub] [sedona] jiayuasu commented on a diff in pull request #863: [SEDONA-213] Add ST_BoundingDiagonal

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


##########
common/src/test/java/org/apache/sedona/common/FunctionsTest.java:
##########
@@ -15,6 +15,7 @@
 
 import com.google.common.geometry.S2CellId;
 import com.google.common.math.DoubleMath;
+import com.sun.org.apache.xpath.internal.operations.Mult;

Review Comment:
   What is this `import`? I don't think this is used.



-- 
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: dev-unsubscribe@sedona.apache.org

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


[GitHub] [sedona] jiayuasu merged pull request #863: [SEDONA-213] Add ST_BoundingDiagonal

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


-- 
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: dev-unsubscribe@sedona.apache.org

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