private static STRtree buildRTree(LongArrayList addresses, List<List<Block>> channels, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel) STRtree rtree = new STRtree(); Operator relateOperator = OperatorFactoryLocal.getInstance().getOperator(Operator.Type.Relate);
public SpatialIndexFeatureCollection() { this.index = new STRtree(); }
public SpatialIndexFeatureCollection(SimpleFeatureType schema) { this.index = new STRtree(); this.schema = schema; }
public synchronized void clear() { index = null; index = new STRtree(); listeners.clear(); listeners = null; }
STRtree tree = new STRtree(); long size = 0; while (it.hasNext()) {
private void fillCache(Query query) throws IOException { Query cloned = new DefaultQuery(query); cloned.getHints().remove(Hints.GEOMETRY_DISTANCE); FeatureCollection features = wrapped.getFeatures(cloned); FeatureIterator fi = features.features(); index = null; STRtree newIndex = new STRtree(); while (fi.hasNext()) { // consider turning all geometries into packed ones, to save space Feature f = fi.next(); newIndex.insert(ReferencedEnvelope.reference(f.getBounds()), f); } fi.close(); index = newIndex; cachedQuery = query; cachedBounds = getEnvelope(query.getFilter()); dirty = false; }
private static STRtree buildSTRtree(Geometry geom) { final STRtree index = new STRtree(); geom.apply(new GeometryFilter() { public void filter(Geometry geom) { // only insert atomic geometries if (geom instanceof GeometryCollection) return; index.insert(geom.getEnvelopeInternal(), geom); } }); return index; }
public STRtreeIndex(int nodeCapacity) { index = new STRtree(nodeCapacity); } STRtree index;
private void buildIndex() { index = new STRtree(); for (int i = 0; i < rings.size(); i++) { LinearRing ring = (LinearRing) rings.get(i); Envelope env = ring.getEnvelopeInternal(); index.insert(env, ring); } } }
public static STRtree build(Geometry g) { STRtree tree = new STRtree(STR_TREE_NODE_CAPACITY); List sections = computeFacetSequences(g); for (Iterator i = sections.iterator(); i.hasNext();) { FacetSequence section = (FacetSequence) i.next(); tree.insert(section.getEnvelope(), section); } tree.build(); return tree; }
STRtree index = new STRtree(STRTREE_NODE_CAPACITY); for (Iterator i = inputPolys.iterator(); i.hasNext(); ) { Geometry item = (Geometry) i.next();
public void testEmptyTreeUsingItemVisitorQuery() { STRtree tree = new STRtree(); tree.query(new Envelope(0,0,1,1), new ItemVisitor() { public void visitItem(Object item) { assertTrue("Should never reach here", true); } }); }
public void testEmptyTreeUsingListQuery() { STRtree tree = new STRtree(); List list = tree.query(new Envelope(0, 0, 1, 1)); assertTrue(list.isEmpty()); }
private static STRtree buildRTree(LongArrayList addresses, List<List<Block>> channels, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel) STRtree rtree = new STRtree(); Operator relateOperator = OperatorFactoryLocal.getInstance().getOperator(Operator.Type.Relate);
private static STRtree buildRTree(LongArrayList addresses, List<List<Block>> channels, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel) STRtree rtree = new STRtree(); Operator relateOperator = OperatorFactoryLocal.getInstance().getOperator(Operator.Type.Relate);
public void testDisallowedInserts() { STRtree t = new STRtree(5); t.insert(new Envelope(0, 0, 0, 0), new Object()); t.insert(new Envelope(0, 0, 0, 0), new Object()); t.query(new Envelope()); try { t.insert(new Envelope(0, 0, 0, 0), new Object()); assertTrue(false); } catch (AssertionFailedException e) { assertTrue(true); } }
public void testSpatialIndex() throws Exception { SpatialIndexTester tester = new SpatialIndexTester(); tester.setSpatialIndex(new STRtree(4)); tester.init(); tester.run(); assertTrue(tester.isSuccess()); }
STRtree sTRtree = new STRtree(); for (int i = 0; i < nb; i++) { Geometry geom = triangles.getGeometryN(i);
public void testRemove() { STRtree tree = new STRtree(); tree.insert(new Envelope(0, 10, 0, 10), "1"); tree.insert(new Envelope(5, 15, 5, 15), "2"); tree.insert(new Envelope(10, 20, 10, 20), "3"); tree.insert(new Envelope(15, 25, 15, 25), "4"); tree.remove(new Envelope(10, 20, 10, 20), "4"); assertEquals(3, tree.size()); }
public void testSerialization() throws Exception { SpatialIndexTester tester = new SpatialIndexTester(); tester.setSpatialIndex(new STRtree(4)); tester.init(); STRtree tree = (STRtree) tester.getSpatialIndex(); // create the index before serialization tree.query(new Envelope()); byte[] data = SerializationUtil.serialize(tree); tree = (STRtree) SerializationUtil.deserialize(data); tester.setSpatialIndex(tree); tester.run(); assertTrue(tester.isSuccess()); }