RTree.update
Update the RTree instance. Modifies the rectangles in-place without changing the tree structure. Provided that the changes are small, the search efficiency should be close to that of freshly built RTree.
A user-defined function which takes as arguments a rectangle and the context ctx passed as the final argument, it should return the (usually modified) context;
Any object, this will be passed as the second input argument
to the function f. If that function does not access
the context, then the update
method can omit it.
Example:
A function which shifts all rectangles by 1 on each axis:
function val = f (rect, context) val = rect + 1; endfunction |
called as rtree.update (@f)
.
Note that in the C library, the implementation (via a C callback function) is much faster than rebuilding the R-tree; in this Octave interface the callback must convert C floats to Octave, modify them and then convert the returned Octave floats to C; so we would expect that it loses much of its competitive advantage when compared to an R-tree rebuild.