geocaml / ocaml-rtree

A pure OCaml implementation of R-Trees
BSD 3-Clause "New" or "Revised" License
26 stars 7 forks source link

Add functions to remove elements from an rtree #37

Open patricoferris opened 8 months ago

patricoferris commented 8 months ago

At the moment the library only has ways of constructing trees from functions like bulk-loading and inserting elements, it would be good to provide functions for removing elements from trees too. I was thinking of providing two functions:

  1. A function that removes elements based on equality (using the Repr equality function probably) that will return the removed element, the new tree or None if no element was found.
  2. A function that removes all elements contained in some envelope that has a similar return to (1).

There's some prior work in libraries like the Rust one see here for example although I didn't dig too deeply.