use of com.revolsys.geometry.model.impl.BoundingBoxDoubleXY in project com.revolsys.open by revolsys.
the class SpatialIndexTester method doTest.
private void doTest(final SpatialIndex<BoundingBox> index, final double queryEnvelopeExtent, final List<BoundingBox> sourceData) {
int extraMatchCount = 0;
int expectedMatchCount = 0;
int actualMatchCount = 0;
int queryCount = 0;
for (int x = 0; x < CELL_EXTENT * CELLS_PER_GRID_SIDE; x += queryEnvelopeExtent) {
for (int y = 0; y < CELL_EXTENT * CELLS_PER_GRID_SIDE; y += queryEnvelopeExtent) {
final BoundingBox queryEnvelope = new BoundingBoxDoubleXY(x, y, x + queryEnvelopeExtent, y + queryEnvelopeExtent);
final List<BoundingBox> expectedMatches = intersectingEnvelopes(queryEnvelope, sourceData);
final List<BoundingBox> actualMatches = index.getItems(queryEnvelope);
// expected value
if (expectedMatches.size() > actualMatches.size()) {
this.isSuccess = false;
}
extraMatchCount += actualMatches.size() - expectedMatches.size();
expectedMatchCount += expectedMatches.size();
actualMatchCount += actualMatches.size();
compare(expectedMatches, actualMatches);
queryCount++;
}
}
}
Aggregations