Ejemplo n.º 1
0
        public void RunQueries()
        {
            var visitor = new CountItemVisitor <object>();

            int size = _index.Count;
            int side = (int)Math.Sqrt(size);

            for (int i = 0; i < side; i++)
            {
                for (int j = 0; j < side; j++)
                {
                    var env = new Envelope(i, i + QUERY_ENV_SIZE, j, j + QUERY_ENV_SIZE);
                    _index.Query(env, visitor);
                }
            }
            Console.WriteLine($"Total query result items = {visitor.Count}");
        }
        private void QueryRandom()
        {
            var env = RandomEnvelope(BASE_MIN, BASE_MAX, 10 * SIZE_MAX);

            var hpVisitor = new CountItemVisitor <object>();

            hpRtree.Query(env, hpVisitor);

            //List hpResult = hpRtree.query(env);
            IList <string> hprResult = null;

            //CountItemVisitor stVisitor = new CountItemVisitor();
            //stRtree.query(env, stVisitor);

            //List strResult = stRtree.query(env);
            IList <string> strResult = null;

            CheckResults(hprResult, strResult);
        }