Example #1
0
        protected override void OnExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
        {
            ExecuteIntersectionQuery(geom.EnvelopeInternal, ds);

            //index of last added feature data table
            var index = ds.Tables.Count - 1;

            if (index <= 0)
            {
                return;
            }

            var res = CloneTableStructure(ds.Tables[index]);

            res.BeginLoadData();

            var fdt = ds.Tables[index];

            foreach (FeatureDataRow row in fdt.Rows)
            {
                if (PreparedGeometry.Intersects(row.Geometry))
                {
                    var fdr = (FeatureDataRow)res.LoadDataRow(row.ItemArray, true);
                    fdr.Geometry = row.Geometry;
                }
            }

            res.EndLoadData();

            ds.Tables.RemoveAt(index);
            ds.Tables.Add(res);
        }
Example #2
0
        protected override void OnExecuteIntersectionQuery(IGeometry geom, IFeatureCollectionSet ds, CancellationToken?cancellationToken = null)
        {
            var fds = new FeatureDataSet();

            ExecuteIntersectionQuery(geom.EnvelopeInternal, fds);

            //index of last added feature data table
            var index = fds.Tables.Count - 1;

            if (index <= 0)
            {
                return;
            }

            var res = (FeatureDataTable)CloneTableStructure(fds.Tables[index].Clone());

            res.BeginLoadData();

            var fdt = fds.Tables[index];

            foreach (FeatureDataRow row in fdt.Rows)
            {
                if (PreparedGeometry.Intersects(row.Geometry))
                {
                    var fdr = (FeatureDataRow)res.LoadDataRow(row.ItemArray, true);
                    fdr.Geometry = row.Geometry;
                }
            }

            res.EndLoadData();
            ds.Add(res);
            fds.Dispose();
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="geom"></param>
        /// <param name="ds"></param>
        protected override void OnExecuteIntersectionQuery(Geometry geom, FeatureDataSet ds)
        {
            FeatureDataTable dataTable = CreateFeatureDataTable();

            dataTable.BeginLoadData();
            foreach (Feature feature in _features)
            {
                if (PreparedGeometry.Intersects(feature.Geometry))
                {
                    CreateNewRow(dataTable, feature);
                }
            }
            dataTable.EndLoadData();

            ds.Tables.Add(dataTable);
        }