Beispiel #1
0
        private int Execute([NotNull] ITable table, [CanBeNull] IQueryFilter queryFilter)
        {
            var cursor     = new EnumCursor(table, queryFilter, !KeepRows);
            var errorCount = 0;

            foreach (IRow row in cursor)
            {
                if (row is IFeature)
                {
                    // TODO revise

                    // workaround that all spatial searches work properly:
                    // explicitly calculate IsSimple -->
                    // state of shape seems to be consistent afterward
                    var shapeTopoOp = ((IFeature)row).Shape as ITopologicalOperator2;
                    // always, when a shape comes from DB, though it needs not to be true:
                    //Debug.Assert(shp.IsKnownSimple && shp.IsSimple);

                    if (shapeTopoOp != null)
                    {
                        shapeTopoOp.IsKnownSimple_2 = false;
                        bool simple = shapeTopoOp.IsSimple;
                    }
                }

                errorCount += Execute(row);
            }

            return(errorCount);
        }
Beispiel #2
0
        protected IEnumerable <IRow> Search([NotNull] ITable table,
                                            [NotNull] IQueryFilter queryFilter,
                                            [NotNull] QueryFilterHelper filterHelper,
                                            [CanBeNull] IGeometry cacheGeometry = null)
        {
            Assert.ArgumentNotNull(table, nameof(table));
            Assert.ArgumentNotNull(queryFilter, nameof(queryFilter));
            Assert.ArgumentNotNull(filterHelper, nameof(filterHelper));

            if (filterHelper.ContainerTest == null)
            {
                filterHelper.ContainerTest = this;
            }

            if (DataContainer != null)
            {
                IEnumerable <IRow> rows = DataContainer.Search(table, queryFilter,
                                                               filterHelper, cacheGeometry);

                if (rows != null)
                {
                    return(rows);
                }
            }

            // this could be controlled by a flag on the filterHelper or a parameter
            // on the Search() method: AllowRecycling
            const bool recycle = false;
            var        cursor  = new EnumCursor(table, queryFilter, recycle);

            // TestUtils.AddGarbageCollectionRequest();

            return(cursor);
        }
Beispiel #3
0
            public RowEnumerator([NotNull] EnumCursor enumerable)
            {
                Assert.ArgumentNotNull(enumerable, nameof(enumerable));

                _enumerable = enumerable;
            }