Search in sources :

Example 1 with Interval

use of com.revolsys.geometry.index.bintree.Interval in project com.revolsys.open by revolsys.

the class BinTreeCorrectTest method queryGrid.

void queryGrid(final int nGridCells, final double cellSize) {
    final Stopwatch sw = new Stopwatch();
    sw.start();
    int gridSize = (int) Math.sqrt(nGridCells);
    gridSize += 1;
    final double extent = MAX_EXTENT - MIN_EXTENT;
    final double gridInc = extent / gridSize;
    for (int i = 0; i < gridSize; i++) {
        final double x = MIN_EXTENT + gridInc * i;
        final Interval interval = new Interval(x, x + cellSize);
        queryTest(interval);
    // queryTime(env);
    }
// System.out.println("Time = " + sw.getTimeString());
}
Also used : Stopwatch(com.revolsys.geometry.util.Stopwatch) Interval(com.revolsys.geometry.index.bintree.Interval)

Example 2 with Interval

use of com.revolsys.geometry.index.bintree.Interval in project com.revolsys.open by revolsys.

the class BinTreeCorrectTest method newGrid.

void newGrid(final int nGridCells) {
    int gridSize = (int) Math.sqrt(nGridCells);
    gridSize += 1;
    final double extent = MAX_EXTENT - MIN_EXTENT;
    final double gridInc = extent / gridSize;
    final double cellSize = 2 * gridInc;
    for (int i = 0; i < gridSize; i++) {
        final double x = MIN_EXTENT + gridInc * i;
        final Interval interval = new Interval(x, x + cellSize);
        this.btree.insert(interval, interval);
        this.intervalList.add(interval);
    }
}
Also used : Interval(com.revolsys.geometry.index.bintree.Interval)

Aggregations

Interval (com.revolsys.geometry.index.bintree.Interval)2 Stopwatch (com.revolsys.geometry.util.Stopwatch)1