コード例 #1
0
        public void CanSearchEmpty()
        {
            var spatialIndex = new ExceptionObjectSpatialIndex();

            IPoint point = GeometryFactory.CreatePoint(1000, 1000);

            List <ExceptionObject> exceptionObjects = spatialIndex.Search(point).ToList();

            Assert.AreEqual(0, exceptionObjects.Count);
        }
コード例 #2
0
        private static void AssertCanFindGeometry([NotNull] IGeometry geometry)
        {
            ExceptionObject exceptionObject = CreateExceptionObject(1, geometry);

            var spatialIndex = new ExceptionObjectSpatialIndex();

            spatialIndex.Add(exceptionObject);

            List <ExceptionObject> exceptionObjects = spatialIndex.Search(geometry).ToList();

            Assert.AreEqual(1, exceptionObjects.Count);
        }
コード例 #3
0
        public void CanSearchCoincidentPoints()
        {
            IPoint point = GeometryFactory.CreatePoint(1000, 1000);

            var spatialIndex = new ExceptionObjectSpatialIndex();

            const int count = 100;

            for (int i = 0; i < count; i++)
            {
                spatialIndex.Add(CreateExceptionObject(1, GeometryFactory.Clone(point)));
            }

            List <ExceptionObject> exceptionObjects = spatialIndex.Search(point).ToList();

            Assert.AreEqual(count, exceptionObjects.Count);
        }