Search in sources :

Example 1 with SimpleSplitStrategy

use of org.bboxdb.distribution.partitioner.regionsplit.SimpleSplitStrategy in project bboxdb by jnidzwetzki.

the class TestSampling method testSimpleSplitpointStrategy1.

/**
 * Test the simple splitpoint strategy
 * @throws StorageManagerException
 */
@Test(timeout = 60000)
public void testSimpleSplitpointStrategy1() throws StorageManagerException {
    final SplitpointStrategy splitpointStrategy = new SimpleSplitStrategy();
    final BoundingBox coveringBox = new BoundingBox(1d, 2d, -1d, 20d);
    final double splitPoint0 = splitpointStrategy.getSplitPoint(0, coveringBox);
    final double splitPoint1 = splitpointStrategy.getSplitPoint(1, coveringBox);
    Assert.assertTrue(coveringBox.isCoveringPointInDimension(splitPoint0, 0));
    Assert.assertTrue(coveringBox.isCoveringPointInDimension(splitPoint1, 1));
}
Also used : BoundingBox(org.bboxdb.commons.math.BoundingBox) SimpleSplitStrategy(org.bboxdb.distribution.partitioner.regionsplit.SimpleSplitStrategy) SplitpointStrategy(org.bboxdb.distribution.partitioner.regionsplit.SplitpointStrategy) Test(org.junit.Test)

Aggregations

BoundingBox (org.bboxdb.commons.math.BoundingBox)1 SimpleSplitStrategy (org.bboxdb.distribution.partitioner.regionsplit.SimpleSplitStrategy)1 SplitpointStrategy (org.bboxdb.distribution.partitioner.regionsplit.SplitpointStrategy)1 Test (org.junit.Test)1