/// <inheritdoc cref="ISpatialIndex{T}.Query(Envelope)"/>
        public IList <T> Query(Envelope searchBounds)
        {
            var visitor = new ArrayListVisitor <T>();

            Query(searchBounds, visitor);
            return(visitor.Items);
        }
        public void TestEmpty()
        {
            var spitree = new SortedPackedIntervalRTree <object>();
            var visitor = new ArrayListVisitor <object>();

            Assert.That(() => spitree.Query(0, 1, visitor), Throws.Nothing);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="searchEnv"></param>
        /// <returns></returns>
        public virtual IList Query(IEnvelope searchEnv)
        {
            /*
             * the items that are matched are the items in quads which
             * overlap the search envelope
             */
            ArrayListVisitor visitor = new ArrayListVisitor();

            Query(searchEnv, visitor);
            return(visitor.Items);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Queries the tree and returns items which may lie in the given search envelope.
        /// </summary>
        /// <remarks>
        /// Precisely, the items that are returned are all items in the tree
        /// whose envelope <b>may</b> intersect the search Envelope.
        /// Note that some items with non-intersecting envelopes may be returned as well;
        /// the client is responsible for filtering these out.
        /// In most situations there will be many items in the tree which do not
        /// intersect the search envelope and which are not returned - thus
        /// providing improved performance over a simple linear scan.
        /// </remarks>
        /// <param name="searchEnv">The envelope of the desired query area.</param>
        /// <returns>A List of items which may intersect the search envelope</returns>
        public IList <T> Query(Envelope searchEnv)
        {
            /*
             * the items that are matched are the items in quads which
             * overlap the search envelope
             */
            var visitor = new ArrayListVisitor <T>();

            Query(searchEnv, visitor);
            return(visitor.Items);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="searchEnv"></param>
 /// <returns></returns>
 public IList Query(IEnvelope searchEnv)
 {
     /*
     * the items that are matched are the items in quads which
     * overlap the search envelope
     */
     ArrayListVisitor visitor = new ArrayListVisitor();
     Query(searchEnv, visitor);
     return visitor.Items;
 }