Search in sources :

Example 6 with CellGrid

use of org.bboxdb.storage.entity.CellGrid in project bboxdb by jnidzwetzki.

the class TestCellGrid method testEmptyGrid.

/**
 * Test the empty grid
 */
@Test(expected = IllegalArgumentException.class)
public void testEmptyGrid() {
    final CellGrid cellGrid = CellGrid.buildWithFixedAmountOfCells(new BoundingBox(1.0, 1.0, 1.0, 1.0), 10);
    final BoundingBox fullBox = BoundingBox.createFullCoveringDimensionBoundingBox(2);
    cellGrid.getAllInersectedBoundingBoxes(fullBox);
}
Also used : BoundingBox(org.bboxdb.commons.math.BoundingBox) CellGrid(org.bboxdb.storage.entity.CellGrid) Test(org.junit.Test)

Example 7 with CellGrid

use of org.bboxdb.storage.entity.CellGrid in project bboxdb by jnidzwetzki.

the class TestCellGrid method testWrongDimension.

/**
 * Test the wrong dimension
 */
@Test(expected = RuntimeException.class)
public void testWrongDimension() {
    final CellGrid cellGrid = CellGrid.buildWithFixedAmountOfCells(new BoundingBox(1.0, 1.0, 1.0, 1.0), 1);
    cellGrid.getAllInersectedBoundingBoxes(new BoundingBox(1.0, 1.0));
}
Also used : BoundingBox(org.bboxdb.commons.math.BoundingBox) CellGrid(org.bboxdb.storage.entity.CellGrid) Test(org.junit.Test)

Example 8 with CellGrid

use of org.bboxdb.storage.entity.CellGrid in project bboxdb by jnidzwetzki.

the class TestCellGrid method testHashCodeAndEquals.

/**
 * Hashcode
 */
@Test(timeout = 60000)
public void testHashCodeAndEquals() {
    final CellGrid cellGrid2D1 = CellGrid.buildWithFixedAmountOfCells(new BoundingBox(0.0, 10.0, 0.0, 10.0), 10);
    final CellGrid cellGrid2D2 = CellGrid.buildWithFixedAmountOfCells(new BoundingBox(0.0, 10.0, 0.0, 10.0), 10);
    Assert.assertEquals(cellGrid2D1, cellGrid2D2);
    Assert.assertEquals(cellGrid2D1.hashCode(), cellGrid2D2.hashCode());
}
Also used : BoundingBox(org.bboxdb.commons.math.BoundingBox) CellGrid(org.bboxdb.storage.entity.CellGrid) Test(org.junit.Test)

Aggregations

BoundingBox (org.bboxdb.commons.math.BoundingBox)8 CellGrid (org.bboxdb.storage.entity.CellGrid)8 Test (org.junit.Test)7