https://github.com/roy-corentin/r-tree
Implementation of R-Tree in Elixir
https://github.com/roy-corentin/r-tree
elixir rtree
Last synced: 12 months ago
JSON representation
Implementation of R-Tree in Elixir
- Host: GitHub
- URL: https://github.com/roy-corentin/r-tree
- Owner: roy-corentin
- Created: 2024-03-16T14:34:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-18T18:20:39.000Z (over 1 year ago)
- Last Synced: 2025-04-04T12:12:09.692Z (about 1 year ago)
- Topics: elixir, rtree
- Language: Elixir
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
* Rtree
** Description
Rtree is an implementation of the R-Tree data structure in Elixir. R-Trees are used for indexing multi-dimensional information, such as geographical coordinates. This library provides a robust and efficient way to manage and query spatial data.
** Installation
If available in Hex, the package can be installed by adding `rtree` to your list of dependencies in `mix.exs`:
#+begin_src elixir
def deps do
[
{:rtree, github: "roy-corentin/R-Tree"}
]
end
#+end_src
** Usage
Here is a basic example of how to use the Rtree library:
#+begin_src elixir
# Create a new R-Tree node with a limit of 2 objects per node
node = %RNode{limit: 2}
# Insert objects into the R-Tree
node = RTree.insert(node, %RObject{x: 1, y: 1, data: "data1"})
node = RTree.insert(node, %RObject{x: 2, y: 2, data: "data2"})
node = RTree.insert(node, %RObject{x: 3, y: 3, data: "data3"})
# Search for an object in the R-Tree
case RTree.search(node, %{x: 2, y: 2}) do
{:ok, object} -> IO.puts("Found object: #{inspect(object)}")
{:error, "Not Found"} -> IO.puts("Object not found")
end
#+end_src
** Documentation
Documentation can be generated with [[ExDoc][https://github.com/elixir-lang/ex_doc]] and published on [[HexDocs][https://hexdocs.pm]]. Once published, the docs can be found at .
** Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.