use of org.bboxdb.storage.sstable.spatialindex.SpatialIndexReader in project bboxdb by jnidzwetzki.
the class RTreeTestHelper method queryIndex.
/**
* Test the query
*
* @param entries
* @param index
* @throws StorageManagerException
*/
public static void queryIndex(final List<SpatialIndexEntry> entries, final SpatialIndexReader index) throws StorageManagerException {
for (final SpatialIndexEntry entry : entries) {
final List<? extends SpatialIndexEntry> resultList = index.getEntriesForRegion(entry.getBoundingBox());
Assert.assertTrue(resultList.size() >= 1);
final List<Integer> keyResult = resultList.stream().map(e -> e.getValue()).filter(k -> k.equals(entry.getValue())).collect(Collectors.toList());
Assert.assertTrue("Searching for: " + entry, keyResult.size() == 1);
}
}
Aggregations