#[repr(C)]pub struct NodeItem {
pub min_x: f64,
pub min_y: f64,
pub max_x: f64,
pub max_y: f64,
pub offset: u64,
}Expand description
R-Tree node
Fields§
§min_x: f64§min_y: f64§max_x: f64§max_y: f64§offset: u64Byte offset in feature data section
Implementations§
Source§impl NodeItem
impl NodeItem
pub fn bounds(min_x: f64, min_y: f64, max_x: f64, max_y: f64) -> NodeItem
pub fn create(offset: u64) -> NodeItem
pub fn from_reader(rdr: impl Read) -> Result<Self, Error>
pub fn write<W: Write>(&self, wtr: &mut W) -> Result<()>
pub fn width(&self) -> f64
pub fn height(&self) -> f64
pub fn sum(a: NodeItem, b: &NodeItem) -> NodeItem
pub fn expand(&mut self, r: &NodeItem)
pub fn expand_xy(&mut self, x: f64, y: f64)
pub fn intersects(&self, r: &NodeItem) -> bool
Sourcepub fn contains_point(&self, x: f64, y: f64) -> bool
pub fn contains_point(&self, x: f64, y: f64) -> bool
Check if a point is inside or on the boundary of this NodeItem’s bounding box
Sourcepub fn centroid_distance_squared(&self, x: f64, y: f64) -> f64
pub fn centroid_distance_squared(&self, x: f64, y: f64) -> f64
Calculate the squared Euclidean distance from a point to the centroid of this NodeItem
Sourcepub fn min_distance_squared(&self, x: f64, y: f64) -> f64
pub fn min_distance_squared(&self, x: f64, y: f64) -> f64
Calculate the minimum squared distance from a point to this NodeItem’s bounding box Returns 0 if the point is inside the bbox
Trait Implementations§
impl StructuralPartialEq for NodeItem
Auto Trait Implementations§
impl Freeze for NodeItem
impl RefUnwindSafe for NodeItem
impl Send for NodeItem
impl Sync for NodeItem
impl Unpin for NodeItem
impl UnsafeUnpin for NodeItem
impl UnwindSafe for NodeItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more