Packages

Distributed Dynamic R-tree (DDRT) implementation for Elixir. It's mainly a R-tree. Why dynamic? Because it's optimized to do fast updates at the tree leafs spatial index. Why distributed? Well.. you can run the DDRT on different nodes and they will have the same r-tree data.

Retired package: Renamed - Package name was changed, look for 'ddrt' hex package to get it. https://hex.pm/packages/ddrt

Current section

Files

Jump to
dynamic_rtree lib elixir_rtree bounding_box_generator.ex
Raw

lib/elixir_rtree/bounding_box_generator.ex

defmodule BoundingBoxGenerator do
@moduledoc false
def generate(n,size,result)do
s = size/2
x = Enum.random(-180..180)
y = Enum.random(-90..90)
if n > 0, do: generate(n - 1, size, [[{x-s,x+s},{y-s,y+s}]] ++ result), else: result
end
end