pranavbhole commented on code in PR #16029:
URL: https://github.com/apache/druid/pull/16029#discussion_r1536112027
##########
processing/src/main/java/org/apache/druid/collections/spatial/RTreeUtils.java:
##########
@@ -71,4 +72,41 @@ public static void enclose(Node[] nodes)
}
}
+ /**
+ * Returns distance between two geo coordinates in meters according to
https://en.wikipedia.org/wiki/Haversine_formula
+ */
+ public static double calculateHaversineDistance(double[] coord1, double[]
coord2)
+ {
+ if (coord1.length != 2 || coord2.length != 2) {
+ throw new IllegalArgumentException("Invalid coordinate array size");
+ }
+
+ // Extract latitude and longitude from the coordinate arrays
+ double lat1 = coord1[0];
+ double lon1 = coord1[1];
+ double lat2 = coord2[0];
+ double lon2 = coord2[1];
Review Comment:
fixed
##########
processing/src/main/java/org/apache/druid/collections/spatial/search/Bound.java:
##########
@@ -24,8 +24,11 @@
import org.apache.druid.annotations.SubclassesMustOverrideEqualsAndHashCode;
import org.apache.druid.collections.spatial.ImmutableNode;
import org.apache.druid.collections.spatial.ImmutablePoint;
+import org.apache.druid.collections.spatial.hp.ImmutableDoubleNode;
+import org.apache.druid.collections.spatial.hp.ImmutableDoublePoint;
/**
+ *
Review Comment:
fixed
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]