Пример #1
0
        public IGeometry Union()
        {
            if (inputPolys.Count == 0)
                return null;
            geomFactory = Factory();

            /**
             * A spatial index to organize the collection
             * into groups of close geometries.
             * This makes unioning more efficient, since vertices are more likely 
             * to be eliminated on each round.
             */
            var index = new STRtree(StrtreeNodeCapacity);
            foreach (IGeometry item in inputPolys)
                index.Insert(item.EnvelopeInternal, item);

            var itemTree = index.ItemsTree();
            var unionAll = UnionTree(itemTree);
            return unionAll;
        }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="container"></param>
 public AnonymousYComparerImpl(STRtree container)
 {
     this.container = container;
 }
Пример #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="container"></param>
 public AnonymousIntersectsOpImpl(STRtree container)
 {
     this.container = container;
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MCIndexPointSnapper"/> class.
 /// </summary>
 /// <param name="monoChains"></param>
 /// <param name="index"></param>
 public MCIndexPointSnapper(IList monoChains, ISpatialIndex index)
 {
     this.monoChains = monoChains;
     this.index = (STRtree) index;
 }
Пример #5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="container"></param>
 public AnonymousYComparerImpl(STRtree container)
 {
     this.container = container;
 }
Пример #6
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="container"></param>
 public AnonymousIntersectsOpImpl(STRtree container)
 {
     this.container = container;
 }
Пример #7
0
        public void TestStrIndex()
        {
            STRtree ndx = new STRtree();

            foreach (var v in CreateTestGeometries(1000, 0.0, 0.0, 3000.0, 3000.0))
                ndx.Insert(v.EnvelopeInternal, v);

            ndx.Build();
            IEnvelope queryExtents = new Envelope(100.0, 120.0, 100.0, 120.0);
            IList matches = ndx.Query(queryExtents);
            foreach (IGeometry list in matches)
            {
                Assert.IsTrue(list.EnvelopeInternal.Intersects(queryExtents), "a result from the index does not intersect the query bounds");
            }

        }