use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.
the class STRtreeTest method testDisallowedInserts.
public void testDisallowedInserts() {
final StrTree t = new StrTree(5);
t.insertItem(new BoundingBoxDoubleXY(0, 0, 0, 0), new Object());
t.insertItem(new BoundingBoxDoubleXY(0, 0, 0, 0), new Object());
t.getItems(BoundingBox.empty());
try {
t.insertItem(new BoundingBoxDoubleXY(0, 0, 0, 0), new Object());
assertTrue(false);
} catch (final IllegalStateException e) {
assertTrue(true);
}
}
use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.
the class RectanglePredicateSyntheticTest method getTestGeometries.
private List<Geometry> getTestGeometries() {
final BoundingBox testEnv = new BoundingBoxDoubleXY(this.rectEnv.getMinX() - this.bufSize, this.rectEnv.getMinY() - this.bufSize, this.rectEnv.getMaxX() + this.bufSize, this.rectEnv.getMaxY() + this.bufSize);
final List<Geometry> testGeoms = newTestGeometries(testEnv, 5, this.testGeomSize);
return testGeoms;
}
use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.
the class MCIndexedPointInAreaLocator method locate.
@Override
public Location locate(final double x, final double y) {
final RayCrossingCounter rcc = new RayCrossingCounter(x, y);
final MCSegmentCounter mcSegCounter = new MCSegmentCounter(rcc);
final BoundingBox rayEnv = new BoundingBoxDoubleXY(x, y, this.maxXExtent, y);
final List mcs = this.index.query(rayEnv);
countSegs(rcc, rayEnv, mcs, mcSegCounter);
return rcc.getLocation();
}
use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.
the class TestSerializable method newData.
List newData() {
final List objList = new ArrayList();
final BoundingBox env = new BoundingBoxDoubleXY(123, 123, 456, 456);
objList.add(env);
objList.add(GeometryTestFactory.newBox(fact, 0.0, 100.0, 10, 10.0));
return objList;
}
use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.
the class QuadtreeCorrectTest 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++) {
for (int j = 0; j < gridSize; j++) {
final double x = MIN_EXTENT + gridInc * i;
final double y = MIN_EXTENT + gridInc * j;
final BoundingBox env = new BoundingBoxDoubleXY(x, y, x + cellSize, y + cellSize);
queryTest(env);
// queryTime(env);
}
}
// System.out.println("Time = " + sw.getTimeString());
}
Aggregations