Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 569 Bytes

existence_queries.md

File metadata and controls

26 lines (18 loc) · 569 Bytes

Existence Queries

We can use contains to decide whether a point is already inserted to the tree or not. Here is an example:

use rstar::RTree;

fn main() {
    let tree = RTree::bulk_load(vec![(0, 0), (1, 2), (8, 5)]);

    println!("{}", tree.contains(&(1, 2)));
    println!("{}", tree.contains(&(100, 100)));
}

Output:

true
false

➡️ Next: Nearest Neighbor Queries

📘 Back: Table of contents