Esempio n. 1
0
        public void TestRadiusQuery()
        {
            // Verify that circular query works
            KDBush <int> kdbush = new KDBush <int>(10);

            kdbush.Index(points);

            var result = kdbush.Query(50, 50, 20);

            List <int> correctPoints = new List <int>(new int[] { 60, 6, 25, 92, 42, 20, 45, 3, 71, 44, 18, 96 });

            AssertPointsMatch(correctPoints, result);
        }
Esempio n. 2
0
        public void TestRectQuery()
        {
            // Verify that rectangular query works
            KDBush <int> kdbush = new KDBush <int>(10);

            kdbush.Index(points);

            var result = kdbush.Query(20, 30, 50, 70);

            List <int> correctPoints = new List <int>(new int[] { 60, 20, 45, 3, 17, 71, 44, 19, 18, 15, 69, 90, 62, 96, 47, 8, 77, 72 });

            AssertPointsMatch(correctPoints, result);
        }