None
PL
R-Tree: algorithm for efficient indexing of spatial data
[]
Bartosz Sypytkowski
module Node let private addLeaf config item node = let rect = Entry.boundary item // try find entry matching added item's key let idx = node.entries |> Array.tryFindIndex (function Leaf(k, _) -> k.Boundary = rect | _ -> false) match idx with | None -> // item with that key didn't exist in R-Tree, // push it at the end of children list let entries = Array.insertAt node.entries.Length item node.entries let node = { node with entries = entries } if n.entries.Length > config.maxCap then // we surpassed capacity of node, we need to split it let struct(l, r) = split config node Split(l,r) else NoSplit node | Some idx -> // we're updating an existing entry let node = { node with entries = Array.replace idx item n.entries } NoSplit node module Node let rec add (config: Config) level (item:…