use of com.github.davidmoten.rtree2.geometry.Point in project rtree2 by davidmoten.
the class RTreeTest method testBulkLoadingEntryCount.
@Test
public void testBulkLoadingEntryCount() {
List<Entry<Integer, Geometry>> entries = new ArrayList<Entry<Integer, Geometry>>(10000);
for (int i = 1; i <= 10000; i++) {
Point point = nextPoint();
// System.out.println("point(" + point.x() + "," + point.y() +
// "),");
entries.add(new EntryDefault<Integer, Geometry>(i, point));
}
RTree<Integer, Geometry> tree = RTree.create(entries);
int entrySize = Observable.from(tree.entries()).count().toBlocking().single();
System.out.println("entry count: " + entrySize);
assertEquals(entrySize, entries.size());
}
Aggregations