jiayuasu commented on code in PR #615:
URL: https://github.com/apache/incubator-sedona/pull/615#discussion_r855807148


##########
flink/src/main/java/org/apache/sedona/flink/expressions/Functions.java:
##########
@@ -110,4 +111,36 @@ public String eval(@DataTypeHint(value = "RAW", bridgedTo 
= org.locationtech.jts
             return GeomUtils.getEWKT(geom);
         }
     }
+
+    public static class ST_XMax extends ScalarFunction {
+        @DataTypeHint("Double")
+        public Double eval(@DataTypeHint(value = "RAW", bridgedTo = 
org.locationtech.jts.geom.Geometry.class) Object o) {
+            Geometry geom = (Geometry) o;
+            Coordinate[] coord = geom.getCoordinates();
+            double max = Double.MIN_VALUE;
+            for(int i=0;i< coord.length;i++){
+                if(coord[i].getX()>max){
+                    max = coord[i].getX();
+                }
+            }
+            return max;
+        }
+
+    }
+
+    public static class ST_XMin extends ScalarFunction {
+        @DataTypeHint("Double")
+        public Double eval(@DataTypeHint(value = "RAW", bridgedTo = 
org.locationtech.jts.geom.Geometry.class) Object o) {
+            Geometry geom = (Geometry) o;
+            Coordinate[] coord = geom.getCoordinates();
+            double min = Double.MIN_VALUE;

Review Comment:
   This one is a bug. Fix it with MaxValue



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to