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; }
/// <summary> /// /// </summary> /// <param name="container"></param> public AnonymousYComparerImpl(STRtree container) { this.container = container; }
/// <summary> /// /// </summary> /// <param name="container"></param> public AnonymousIntersectsOpImpl(STRtree container) { this.container = container; }
/// <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; }
/// <summary> /// /// </summary> /// <param name="container"></param> public AnonymousYComparerImpl(STRtree container) { this.container = container; }
/// <summary> /// /// </summary> /// <param name="container"></param> public AnonymousIntersectsOpImpl(STRtree container) { this.container = container; }
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"); } }