R树的Java实现 [英] R-Tree Implementation Java
问题描述
我在寻找的最后几天稳定实现R树与支持无限制的尺寸(20左右就足够了)的。我才发现这 http://sourceforge.net/projects/jsi/ 但他们只支持2维
I was searching the last few days for a stable implementation of the R-Tree with support of unlimited dimensions (20 or so would be enough). I only found this http://sourceforge.net/projects/jsi/ but they only support 2 dimensions.
另一种选择将是一个多层面的执行情况的区间树。
Another Option would be a multidimensional implementation of an interval-tree.
也许我是完全地错用R树或INTERVALL树我的问题的想法,所以我陈述问题,总之,你可以给我你的想法这件事。
Maybe I'm completly wrong with the idea of using an R-Tree or Intervall-Tree for my Problem so i state the Problem in short, that you can send me your thoughts about this.
我需要解决的问题是一些最近邻搜索。我有一组天线和房间的,并为每个天线整数的区间。例如。天线1,最小-92,最大值-85。事实上,它可以重新presented的房间 - >设置天线 - >间隔天线。 的想法是,每室跨越在R-树一个框的天线的尺寸,然后在每个维度的间隔。
The Problem I need to solve is some kind of nearest-neighbour search. I have a set of Antennas and rooms and for each antenna an interval of Integers. E.g. antenna 1, min -92, max -85. In fact it could be represented as room -> set of antennas -> interval for antenna. The idea was that each room spans a box in the R-Tree over the dimension of the antennas and in each dimension by the interval.
如果我得到的N-天线和值的查询每个天线然后,我可能只是重新present信息作为房间里的查询点和检索最近房间的地步。
If I get a query with N-Antennas and values for each antenna I then could just represent the Information as a query point in the room and retrieve the rooms "nearest" to the point.
希望你有这个问题,我的想法的想法。
Hope you got an Idea of the problem and my idea.
推荐答案
请注意,R-树能降低严重,当你有离散的数据。你真的需要找出的第一件事就是一个合适的数据重新presentation,然后进行测试,如果您查询的数据子集的工作。
Be aware that R-Trees can degrade badly when you have discrete data. The first thing you really need to find out is an appropriate data representation, then test if your queries work on a subset of the data.
R-树木只会让你查询的更快的。如果他们不摆在首位的工作,它不会帮助。 您应该测试你的方法不首先使用R-树。除非你打了大量的数据(例如,100.000对象),线性扫描内存可以轻松地超越了R树,尤其是当你需要一些适配层,因为它不是很好,综合型与你的code。
R-Trees will only make your queries faster. If they don't work in the first place, it will not help. You should test your approach without using R-Trees first. Unless you hit a large amount of data (say, 100.000 objects), a linear scan in-memory can easily outperform an R-Tree, in particular when you need some adapter layer because it is not well-intergrated with your code.
在这里最明显的方法是,仅仅使用边界矩形,然后线性扫描他们。如果他们的工作,然后你可以存储在一个R树的膜生物反应器,以获得一些性能改进。 但是,如果它不与线性扫描工作,也不会与R树擦出火花(它不会工作得更快。)
The obvious approach here is to just use bounding rectangles, and linearly scan over them. If they work, you can then store the MBRs in an R-Tree to get some performance improvements. But if it doesn't work with a linear scan, it won't work with an R-Tree either (it will not work faster.)
这篇关于R树的Java实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!