Exemple #1
0
        public void TestCreateAndExtendByMassiveNumber()
        {
            _data = CreateSampleData(50000, new Envelope(-100, 100, -100, 100));
            var tree = SbnTree.Create(_data, null, null);

            Assert.That(tree.FeatureCount == 50000);
            foreach (var tuple in CreateSampleData(50000, new Envelope(-100, 100, -100, 100), 50001))
            {
                tree.Insert(tuple.Item1, tuple.Item2, null, null);
            }
            Assert.IsTrue(tree.FeatureCount == 100000);
        }
Exemple #2
0
        public void TestCreateAndExtend()
        {
            _data = CreateSampleData(50000, new Envelope(-100, 100, -100, 100));
            var tree = SbnTree.Create(_data, null, null);

            tree.RebuildRequried += HandleRebuildRequired;
            _rebuildRequiredFired = false;
            tree.Insert(500002, new Envelope(-110, -100, -110, -100), null, null);

            Assert.IsTrue(_rebuildRequiredFired);
            tree = SbnTree.Create(_data, tree.ZRange, tree.MRange);
            Assert.IsTrue(tree.FeatureCount == 50001);
            Assert.IsTrue(new Envelope(-110, 100, -110, 100).Contains(tree.Extent));

            //tree = SbnTree.Create(new List<Tuple<uint, Envelope>>(tree.QueryFids(tree.Extent)))
        }
Exemple #3
0
        public void TestCreateAndExtendByMassiveNumberZ()
        {
            _data = CreateSampleData(50000, new Envelope(-100, 100, -100, 100));
            var zRange = Interval.Create(1, 10);
            var tree   = SbnTree.Create(_data, zRange, null);

            Assert.AreEqual(zRange, tree.ZRange);

            foreach (var tuple in CreateSampleData(50000, new Envelope(-100, 100, -100, 100), 50001))
            {
                tree.Insert(tuple.Item1, tuple.Item2, CreateInterval(Interval.Create(0, 20)), null);
            }
            Assert.IsTrue(tree.FeatureCount == 100000);
            Assert.IsTrue(tree.ZRange.Min < 1d);
            Assert.IsTrue(tree.ZRange.Max > 10d);
            Assert.IsTrue(Interval.Create(0, 20).Contains(tree.ZRange));
        }
 ISpatialIndex <uint> ISpatialIndexFactory <uint> .Create(Envelope extent, int expectedNumberOfEntries, IEnumerable <ISpatialIndexItem <uint> > entries)
 {
     return(new SbnTreeWrapper(SbnTree.Create(ToCollection(entries))));
 }