pub fn query(
        &self,
        py: Python,
        x: f64,
        y: f64,
        hit_test: Option<PyObject>,
        key: Option<PyObject>,
    ) -> PyResult<PyObject> {
        let hits = self._query(py, (x, y), |point| self.tree.point_lookup(point), hit_test)?;

        if let Some(key) = key {
            // If a key is provided, then sort our hits vector and return it
            let locals = PyDict::new(py);
            locals.set_item("key", key)?;

            let hits = PyList::new(py, hits).to_object(py);
            hits.call_method(py, "sort", (), Some(locals))?;

            Ok(hits)
        } else {
            // Otherwise return a set of hits
            let hits = PySet::new(py, &hits)?;

            Ok(hits.to_object(py))
        }
    }
/// Finds all items in the tree that intersect with the given point.
Finds all items in the tree that intersect with the given point.
Finds all items in the tree that intersect with the given point .
pub fn query(
        &self,
        py: Python,
        x: f64,
        y: f64,
        hit_test: Option<PyObject>,
        key: Option<PyObject>,
    ) -> PyResult<PyObject> {
        let hits = self._query(py, (x, y), |point| self.tree.point_lookup(point), hit_test)?;
        if let Some(key) = key {
            // If a key is provided, then sort our hits vector and return it
            let locals = PyDict::new(py);
            locals.set_item("key", key)?;
            let hits = PyList::new(py, hits).to_object(py);
            hits.call_method(py, "sort", (), Some(locals))?;
            Ok(hits)
        } else {
            // Otherwise return a set of hits
            let hits = PySet::new(py, &hits)?;
            Ok(hits.to_object(py))
        }
    }
pub fn query ( & self , py : Python , x : f64 , y : f64 , hit_test : Option < PyObject > , key : Option < PyObject > , ) -> PyResult < PyObject > { let hits = self . _query ( py , ( x , y ) , | point | self . tree . point_lookup ( point ) , hit_test ) ? ; if let Some ( key ) = key { // If a key is provided, then sort our hits vector and return it let locals = PyDict :: new ( py ) ; locals . set_item ( " " , key ) ? ; let hits = PyList :: new ( py , hits ) . to_object ( py ) ; hits . call_method ( py , " " , ( ) , Some ( locals ) ) ? ; Ok ( hits ) } else { // Otherwise return a set of hits let hits = PySet :: new ( py , & hits ) ? ; Ok ( hits . to_object ( py ) ) } }
Finds all items in the tree that intersect with the given point.
Finds all items in the tree that intersect with the given point .
&self
py
Python
x
f64
y
f64
hit_test
Option<PyObject>
key
Option<PyObject>
&self
py
Python
x
f64
y
f64
hit_test
Option<PyObject>
key
Option<PyObject>