yyy1000 commented on code in PR #877:
URL: https://github.com/apache/sedona/pull/877#discussion_r1248484316


##########
common/src/main/java/org/apache/sedona/common/Functions.java:
##########
@@ -447,6 +448,17 @@ public static Geometry lineFromMultiPoint(Geometry 
geometry) {
         return GEOMETRY_FACTORY.createLineString(coordinates.toArray(new 
Coordinate[0]));
     }
 
+    public static Geometry closestPoint(Geometry left, Geometry right) {
+        DistanceOp distanceOp = new DistanceOp(left, right);
+        try {
+            Coordinate[] closestPoints = distanceOp.nearestPoints();
+            return GEOMETRY_FACTORY.createPoint(closestPoints[0]);
+        }
+        catch (Exception e) {
+            return null;

Review Comment:
   Based on this, I tried to resolve all your comments! You can review again.  
:) Thanks! 😁



-- 
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