From d5fa5948add48179867b19d61ce033b2bbc0b773 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Sat, 4 Jan 2025 14:47:40 -0500 Subject: [PATCH] Use `AABB::from_point` --- rust/geoarrow/src/scalar/point/scalar.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rust/geoarrow/src/scalar/point/scalar.rs b/rust/geoarrow/src/scalar/point/scalar.rs index 7a4f41e5..2dc44851 100644 --- a/rust/geoarrow/src/scalar/point/scalar.rs +++ b/rust/geoarrow/src/scalar/point/scalar.rs @@ -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 @@ -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()]) } }