Solid k-d tree implementation in javascript? [closed]

被刻印的时光 ゝ 提交于 2019-12-04 14:07:12

问题


I'm looking to do a bunch of distance queries in a simulation, and would prefer not to loop over all the points. (N**2 doesn't scale that well, it turns out).

Is there a solid k-d tree (or other ball tree, I suppose) implementation in javascript that anyone can recommend?


回答1:


Here is another pretty good implementation that might prove useful (disclaimer - I am the author):

https://github.com/ubilabs/kd-tree-javascript




回答2:


Here is a library that I wrote:

  • static-kdtree

In Chrome, it is up to several orders of magnitude faster than Ubilabs' kdtree and supports a larger set of queries (orthogonal range query and bounding sphere). Here is a link to the benchmark results for the latest version of Google Chrome.

  • Chrome 34 benchmark results

It uses CommonJS/npm, but works great with browserify.




回答3:


Late answer but this is a good one https://github.com/dbotha/Javascript-k-d-tree (disclaimer - I know the author)




回答4:


This R-Tree implementation looks pretty good.




回答5:


RBush is another javascript R-Tree implementation.



来源:https://stackoverflow.com/questions/8612329/solid-k-d-tree-implementation-in-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!