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());
}
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);
}
}