This package provides a R-Tree datastructure. This is an efficient data structure for geospatial queries, like find all objects within a given rectangle. See algorithm in http://www-db.deis.unibo.it/courses/SI-LS/papers/Gut84.pdf
function Bounding_Box (Self : Rtree) return Model_Rectangle
Return the minimal rectangle that encloses all the elements in the tree
procedure Clear (Self : in out Rtree)
Remove all nodes from the tree. The objects are not destroyed.
Default_Max_Children : constant Positive := 6;
Default_Min_Children : constant Positive := 3;
procedure Dump_Debug (Self : Rtree)
Debug: print the tree.
function Find
(Self : Rtree; Rect : Model_Rectangle)
return Items_Lists.List
Find all the objects that intersect with the given rectangle.
procedure For_Each_Object
(Self : Rtree;
Callback : not null access procedure
(Item : not null access Abstract_Item_Record'Class);
In_Area : Model_Rectangle := No_Rectangle)
Executes Callback for each item in the given area (or in the whole tree)
procedure Insert
(Self : in out Rtree;
Item : not null access Abstract_Item_Record'Class)
Add a new item to the tree. The object must already have a position.
function Is_Empty (Self : Rtree) return Boolean
Whether the rtree is empty
type Rtree (Min_Children, Max_Children : Positive) is tagged private;
A data structure for storing geospatial information. It splits the space into cells that contain a maximum number of objects, and makes it easy to find out objects within a given region. Min_Children is the minimum number of children in a cell before it is merged with a sibling cell. Max_Children is the maximum number of children in a cell before it is split.