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.

Current section

Files

Jump to
dynamic_rtree lib bounding_box_generator.ex
Raw

lib/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