use of org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder in project bboxdb by jnidzwetzki.
the class RTreeTestHelper method queryIndex.
/**
* Test the query
*
* @param entries
* @param index
*/
public static void queryIndex(final List<SpatialIndexEntry> entries, final SpatialIndexBuilder index) {
for (final SpatialIndexEntry entry : entries) {
final List<? extends SpatialIndexEntry> resultList = index.getEntriesForRegion(entry.getBoundingBox());
Assert.assertTrue(resultList.size() >= 1);
final List<Integer> keyResult = resultList.stream().map(e -> e.getValue()).filter(k -> k.equals(entry.getValue())).collect(Collectors.toList());
Assert.assertTrue("Searching for: " + entry, keyResult.size() == 1);
}
}
use of org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder in project bboxdb by jnidzwetzki.
the class TestRTreeIndex method testBoxQuery4d.
/**
* Test to query the index
*/
@Test(timeout = 60000)
public void testBoxQuery4d() {
final List<SpatialIndexEntry> tupleList = RTreeTestHelper.generateRandomTupleList(4);
final SpatialIndexBuilder index = new RTreeBuilder();
index.bulkInsert(tupleList);
RTreeTestHelper.queryIndex(tupleList, index);
}
use of org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder in project bboxdb by jnidzwetzki.
the class TestRTreeIndex method testBoxQuery3d.
/**
* Test to query the index
*/
@Test(timeout = 60000)
public void testBoxQuery3d() {
final List<SpatialIndexEntry> tupleList = RTreeTestHelper.generateRandomTupleList(3);
final SpatialIndexBuilder index = new RTreeBuilder();
index.bulkInsert(tupleList);
RTreeTestHelper.queryIndex(tupleList, index);
}
use of org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder in project bboxdb by jnidzwetzki.
the class TestRTreeIndex method testBoxQuery2d.
/**
* Test to query the index
*/
@Test(timeout = 60000)
public void testBoxQuery2d() {
final List<SpatialIndexEntry> tupleList = RTreeTestHelper.generateRandomTupleList(2);
final SpatialIndexBuilder index = new RTreeBuilder();
index.bulkInsert(tupleList);
RTreeTestHelper.queryIndex(tupleList, index);
}
use of org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder in project bboxdb by jnidzwetzki.
the class TestRTreeIndex method testBoxQuery1d.
/**
* Test to query the index
*/
@Test(timeout = 60000)
public void testBoxQuery1d() {
final List<SpatialIndexEntry> tupleList = RTreeTestHelper.getEntryList();
final SpatialIndexBuilder index = new RTreeBuilder();
index.bulkInsert(tupleList);
RTreeTestHelper.queryIndex(tupleList, index);
}
Aggregations