Kontinuation commented on code in PR #283:
URL: https://github.com/apache/sedona-db/pull/283#discussion_r2547237299


##########
rust/sedona-geometry/src/interval.rs:
##########
@@ -255,6 +265,12 @@ impl IntervalTrait for Interval {
 
         Self::new(self.lo - distance, self.hi + distance)
     }
+
+    fn intersection(&self, other: &Self) -> Result<Self, SedonaGeometryError> {
+        let new_lo = self.lo.max(other.lo);
+        let new_hi = self.hi.min(other.hi);
+        Ok(Self::new(new_lo, new_hi))
+    }

Review Comment:
   The result of intersecting two disjoint intervals has `res.is_empty() == 
false`, if I interpret the code correctly. This could be a problem.



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