public void TestStrIndex() { StrTree <BufferedCoordinate, IGeometry <BufferedCoordinate> > index = new StrTree <BufferedCoordinate, IGeometry <BufferedCoordinate> >(_geometryFactory); index.BulkLoad( CreateTestGeometries(1000, 0.0, 0.0, 3000.0, 3000.0)); index.Build(); IExtents <BufferedCoordinate> queryExtents = (IExtents <BufferedCoordinate>)_geometryFactory.CreateExtents2D(100.0, 100.0, 120.0, 120.0); IList <IGeometry <BufferedCoordinate> > matches = new List <IGeometry <BufferedCoordinate> >( index.Query(queryExtents)); foreach (IGeometry <BufferedCoordinate> list in matches) { Assert.IsTrue(list.Bounds.Intersects(queryExtents), "a result from the index does not intersect the query bounds"); } }
public UnaryStrTree(StrKind kind, StrTree operand) : base(kind, new[] { operand }) { }
public void TestStrIndex() { StrTree<BufferedCoordinate, IGeometry<BufferedCoordinate>> index = new StrTree<BufferedCoordinate, IGeometry<BufferedCoordinate>>(_geometryFactory); index.BulkLoad( CreateTestGeometries(1000, 0.0, 0.0, 3000.0, 3000.0)); index.Build(); IExtents<BufferedCoordinate> queryExtents = (IExtents<BufferedCoordinate>)_geometryFactory.CreateExtents2D(100.0, 100.0, 120.0, 120.0); IList<IGeometry<BufferedCoordinate>> matches = new List<IGeometry<BufferedCoordinate>>( index.Query(queryExtents)); foreach (IGeometry<BufferedCoordinate> list in matches) { Assert.IsTrue(list.Bounds.Intersects(queryExtents), "a result from the index does not intersect the query bounds"); } }