Basic Spatial Types

SpatialIndexing.SpatialElemType

Simple N-dimensional spatial data element that stores values of type V and could be referenced by the id of type K (if K is not Nothing).

Supports HasMBR{Rect{T,N}} and HasID{K} (if K is not Nothing) traits.

source
SpatialIndexing.HasMBRType

Type trait for checking mbr() method support. If type V has this trait (mbrtype(V) returns HasMBR{Rect{T,N}}), then mbr(v::V) should return a minimal bounding rectangle (MBR) Rect{T,N} that contains v. If V doesn't have this trait, mbrtype(V) returns HasNoMBR.

SpatialIndex{T,N,V} requires that V provides mbr() method that returns Rect{T,N}.

source
SpatialIndexing.HasIDType

Type trait for checking id() method support. If type V has this trait (idtype(V) returns HasID{K}), then id(v::V) should return a unique identifier for v of type K. If V doesn't have this trait, idtype(V) returns HasNoID.

If available, SpatialIndex{T,N,V} uses unique identifiers of V alongside spatial indexing.

source
SpatialIndexing.subtract!Function
subtract!(tree::RTree, reg::Region)

Subtracts the region from the tree, i.e. removes all elements within region.

source
SpatialIndexing.load!Function
load!(tree::RTree{T,N,V}, data::Any;
      convertel = identity, method = :OMT,
      leaf_fill = capacity(Leaf, tree),
      branch_fill::Tuple{Integer, Integer} = omt_branch_fill(tree)) where {T,N,V}

Bulk-load data into tree.

  • tree: an empty R-tree for storing elements of type V
  • data: iterable container with the elements to put into tree
  • convertel: function to convert elements of data to type V
  • method: bulk-loading method
  • leaf_fill: the average number of elements to store in R-tree leaves (1-level nodes)
  • branch_fill: the tuple of the number of slices and the number of subtrees per slice in the R-tree nodes (level ≥ 1).

The supported bulk-loading methods are:

  • :OMT: Overlap Minimizing Top-down method by Taewon Lee and Sukho Lee
source