/** * @param env * @return a list of objects intersecting the given boundingbox. */ @Override public LinkedList<T> query( float[] env ) { if ( root != null ) { // final float[] bbox = new float[] { env.getMin().get0(), env.getMin().get1(), // env.getMax().get0(), env.getMax().get1() }; if ( intersects( env, this.rootbbox, 2 ) ) { return query( env, root ); } } LOG.debug( "Querying either a null tree or with a envelope that does not intersect it... returning." ); return new LinkedList<T>(); }
private LinkedList<T> query( final float[] bbox, NodeEntry<T>[] node ) { LinkedList<T> list = new LinkedList<T>(); for ( NodeEntry<T> e : node ) { if ( e != null && intersects( bbox, e.bbox, 2 ) ) { if ( e.next == null ) { list.add( e.entryValue ); // rb: uncommented if ( ( list.size() >= bigM * 10 && outputWarning ) ) { outputWarning = false; // LOG.warn( // "Collecting features should stop because {} features were loaded, which was 10 times larger then the maxNumberOfObjects {} (which is currently hardcoded). Continue filling the list though.", // list.size(), this.maxNumberOfObjects ); // return list; } } else { list.addAll( query( bbox, e.next ) ); if ( ( list.size() >= bigM * 10 ) && outputWarning ) { outputWarning = false; // LOG.warn( // "Collecting features should stop because {} features were loaded, which was 10 times larger then the maxNumberOfObjects {} (which is currently hardcoded). Continue filling the list though.", // list.size(), this.maxNumberOfObjects ); // return list; } } } } return list; }
fc = new GenericFeatureCollection( null, index.query( floats ) );