Ejemplo n.º 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);
        }
Ejemplo n.º 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)))
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 4
0
 ISpatialIndex <uint> ISpatialIndexFactory <uint> .Create(Envelope extent, int expectedNumberOfEntries, IEnumerable <ISpatialIndexItem <uint> > entries)
 {
     return(new SbnTreeWrapper(SbnTree.Create(ToCollection(entries))));
 }