Open joverwey opened 1 year ago
This is by design as we don't want the geometry to change. Try GeomWithData<G, Cell<T>>
. Then you can replace the inner T
as per Cell
semantics (incl. replace with immutable ref. if T is copy; usize is)
Does locate_in_envelope_intersecting_mut
have the same issue? It seems like it allows us to change the geometry, but the tree wouldn't know that the envelope haw changed.
The
nearest_neighbour()
function returns an immutable reference to and existing node. Nodes with data associated with it, likeGeomWithData<[f32;3], usize>
, cannot be modified inplace. Instead one has to usepop_nearest_neighbor
, change the data, and then reinsert it.An use example case for this is an rtree that keeps visitation counts for a set of positions.