find overlapping rectangles algorithm

后端 未结 12 1793
悲&欢浪女
悲&欢浪女 2020-12-16 17:29

let\'s say I have a huge set of non-overlapping rectangle with integer coordinates, who are fixed once and for all

I have another rectangle A with integer coordinate

12条回答
  •  感情败类
    2020-12-16 17:47

    Use an R+ tree, which is most likely precisely the specific tree structure you are looking for. R+ trees explicitly do not allow overlapping in the internal (non-leaf) structure in exchange for speed. As long as no object exists in multiple leaves at once, there is no overlap. In your implementation, rather than support overlap, whenever an object needs to be added to multiple leaves, just return true instead.

    Here is a detailed description of the data structure, including how to manage rectangles: The R+-tree: A dynamic index for multi-dimensional objects

提交回复
热议问题