
* I don't understand why you need a merge() method. Could you explain what you are doing in this method and why it's required?
The get method() of the tree returns the data for the first area that contains the coord. This area should contain all tags of the area itself plus those from areas intersecting it. Maybe this is not correct?
Sounds wrong. If Area a1 is intersected by a2 only in 10% of its area then an element located in the 90% that does not intersect would be tagged with a1 and a2?
The merge() first creates a new nodeElem with the intersection, it merges the tags into this and subtracts the intersection from the others, so only the 10% part gets more tags. Thinking again about this I might not need both subtract() calls since I move the intersection part before the others .
I doubt that merge improves the performance. It breaks two areas into three probably with intersecting bounding boxes. So I would expect that you don't save much contains checks. But don't mind about my doubts: Did you measure a noticeable performance difference? WanMil