mourner / rbush

RBush — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simplify points notation

emersion opened this issue · comments

Now, to add a point, you have to do:

tree.insert([20, 40, 20, 40]);

It would be simplier to do:

tree.insert([20, 40]);

What do you think?

You can do this now by specifying format as ['[0]', '[1]', '[0]', '[1]'].

You mean, tree.insert([20, 40, '[0]', '[1]']); inserts a point at 20,40?

No, I mean:

var tree = rbush(9, ['[0]', '[1]', '[0]', '[1]']);
tree.insert([20, 40]);

Oh, thanks!