MJW - 2010-08-14

Hi, I'm interested in performing a few operations on an RTree that aren't directly supported.  I can implement them as combinations of operations that are supported.  But I'm curious about the possibility of more direct versions.

The main one is an addition with a query included.  I want to add a rectangle-and-id, as one would normally do with the method RTree.add(), and receive as a result the set of ID's of rectangles in the tree that intersected the new one before it was added.  So, this would be a combination of intersects() and add().  Presumably this specialized method could be faster than that combination of two other, less specialized methods.  What do you think?  I think this would have to improve speed, but would it improve speed significantly?  I don't understand RTree well enough to make an accurate guess.

I'm also interested in a rectangle-update operation-one that would replace an ID's rectangle with a different rectangle (probably one that's pretty "close" to the old one), and update the tree accordingly.  I guess I can implement this by calling delete() and then add(), but maybe a much faster method could be designed.  What do you think?

If these specialized operations would improve speed, then the natural next question is, "Would you add them for me?"  But even if the answer is no, it'd be interesting for me to understand more about the possibilities-maybe one day I'll have time to add them myself.

(I think I might also want one more extra-speedy, specialized operation:  a traversal over all ID's in a deterministic order.  But I guess I can easily implement that myself without any help, just by copying intersects() or contains() and then removing the intersection checks.)