Esempio n. 1
0
        public ISpatialIndex BuildIndex(IQueryable<ISpatialDocument> documents)
        {
            if (!documents.Any()) return new EmptySpatialIndex();

            var mercator = new Boundary(new Point(0, 0), 180, 90);
            var quadTree = new QuadTree<SpatialDocument>(mercator);

            foreach (var doc in documents)
            {
                quadTree.Insert(new SpatialDocument(doc));
            }

            var index = new SpatialIndex(quadTree);

            return index;
        }
Esempio n. 2
0
        public ISpatialIndex BuildIndex(IQueryable <ISpatialDocument> documents)
        {
            if (!documents.Any())
            {
                return(new EmptySpatialIndex());
            }

            var mercator = new Boundary(new Point(0, 0), 180, 90);
            var quadTree = new QuadTree <SpatialDocument>(mercator);

            foreach (var doc in documents)
            {
                quadTree.Insert(new SpatialDocument(doc));
            }

            var index = new SpatialIndex(quadTree);

            return(index);
        }