Search in sources :

Example 1 with RTreeBuilder

use of org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder in project bboxdb by jnidzwetzki.

the class TestRTreeIndex method testEmptryRTreeBBox.

/**
 * Test the bounding box of an empty r-tree
 */
@Test(timeout = 60000)
public void testEmptryRTreeBBox() {
    final RTreeBuilder index = new RTreeBuilder();
    final List<? extends SpatialIndexEntry> result = index.getEntriesForRegion(BoundingBox.FULL_SPACE);
    Assert.assertTrue(result.isEmpty());
}
Also used : RTreeBuilder(org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder) Test(org.junit.Test)

Example 2 with RTreeBuilder

use of org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder in project bboxdb by jnidzwetzki.

the class TestRTreeIndex method testBoxesInsert.

/**
 * Test to insert and to read the bounding boxes
 */
@Test(timeout = 60000)
public void testBoxesInsert() {
    final List<SpatialIndexEntry> elements = RTreeTestHelper.getEntryList();
    final SpatialIndexBuilder index = new RTreeBuilder();
    index.bulkInsert(elements);
}
Also used : RTreeBuilder(org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder) SpatialIndexBuilder(org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder) SpatialIndexEntry(org.bboxdb.storage.sstable.spatialindex.SpatialIndexEntry) Test(org.junit.Test)

Example 3 with RTreeBuilder

use of org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder in project bboxdb by jnidzwetzki.

the class TestRTreeIndex method testBoxQuery10d.

/**
 * Test to query the index
 */
@Test(timeout = 60000)
public void testBoxQuery10d() {
    final List<SpatialIndexEntry> tupleList = RTreeTestHelper.generateRandomTupleList(10);
    final SpatialIndexBuilder index = new RTreeBuilder();
    index.bulkInsert(tupleList);
    RTreeTestHelper.queryIndex(tupleList, index);
}
Also used : RTreeBuilder(org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder) SpatialIndexBuilder(org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder) SpatialIndexEntry(org.bboxdb.storage.sstable.spatialindex.SpatialIndexEntry) Test(org.junit.Test)

Example 4 with RTreeBuilder

use of org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder in project bboxdb by jnidzwetzki.

the class TestRTreeIndex method testCovering.

/**
 * Test the covering of the nodes
 */
@Test(timeout = 60000)
public void testCovering() {
    final List<SpatialIndexEntry> tupleList = RTreeTestHelper.generateRandomTupleList(3);
    final RTreeBuilder index = new RTreeBuilder();
    index.bulkInsert(tupleList);
    index.testCovering();
}
Also used : RTreeBuilder(org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder) SpatialIndexEntry(org.bboxdb.storage.sstable.spatialindex.SpatialIndexEntry) Test(org.junit.Test)

Example 5 with RTreeBuilder

use of org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder in project bboxdb by jnidzwetzki.

the class TestRTreeIndex method testBoxQuery1d0.

/**
 * Test to query the index
 */
@Test(timeout = 60000)
public void testBoxQuery1d0() {
    final List<SpatialIndexEntry> tupleList = RTreeTestHelper.getEntryList();
    final SpatialIndexBuilder index = new RTreeBuilder(4);
    index.bulkInsert(tupleList);
    RTreeTestHelper.queryIndex(tupleList, index);
}
Also used : RTreeBuilder(org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder) SpatialIndexBuilder(org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder) SpatialIndexEntry(org.bboxdb.storage.sstable.spatialindex.SpatialIndexEntry) Test(org.junit.Test)

Aggregations

RTreeBuilder (org.bboxdb.storage.sstable.spatialindex.rtree.RTreeBuilder)15 Test (org.junit.Test)15 SpatialIndexBuilder (org.bboxdb.storage.sstable.spatialindex.SpatialIndexBuilder)12 SpatialIndexEntry (org.bboxdb.storage.sstable.spatialindex.SpatialIndexEntry)12 File (java.io.File)4 RandomAccessFile (java.io.RandomAccessFile)4 AbstractRTreeReader (org.bboxdb.storage.sstable.spatialindex.rtree.AbstractRTreeReader)4 BoundingBox (org.bboxdb.commons.math.BoundingBox)2 ArrayList (java.util.ArrayList)1