Skip to content

Commit

Permalink
Use AABB::from_point (#971)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron authored Jan 4, 2025
1 parent b4ecffa commit b1aa184
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rust/geoarrow/src/scalar/point/scalar.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use crate::algorithm::native::bounding_rect::bounding_rect_point;
use crate::algorithm::native::eq::point_eq;
use crate::array::CoordBuffer;
use crate::scalar::Coord;
use crate::trait_::NativeScalar;
use geo_traits::to_geo::ToGeoPoint;
use geo_traits::PointTrait;
use geo_traits::{CoordTrait, PointTrait};
use rstar::{RTreeObject, AABB};

/// An Arrow equivalent of a Point
Expand Down Expand Up @@ -107,8 +106,7 @@ impl RTreeObject for Point<'_> {
type Envelope = AABB<[f64; 2]>;

fn envelope(&self) -> Self::Envelope {
let (lower, upper) = bounding_rect_point(self);
AABB::from_corners(lower, upper)
AABB::from_point([self.coord().unwrap().x(), self.coord().unwrap().y()])
}
}

Expand Down

0 comments on commit b1aa184

Please sign in to comment.