Exemplo n.º 1
0
        public void Prepare(IEnumerable <IFeature> sourceFeatures,
                            IList <IFeature> targetFeatures,
                            IEnvelope processingExtent,
                            bool useMinimalTolerance,
                            ReshapeCurveFilterOptions filterOptions)
        {
            ClipExtent          = processingExtent;
            UseMinimumTolerance = useMinimalTolerance;

            IList <IGeometry> sourceGeometries =
                GdbObjectUtils.GetGeometries(sourceFeatures);

            // Consider remembering the pre-processed sources. But clipping is really fast.
            List <IPolyline> preprocessedSource =
                sourceGeometries
                .Select(
                    g => ChangeGeometryAlongUtils.GetPreprocessedGeometryForExtent(
                        g, processingExtent))
                .ToList();

            var targetGeometries = GdbObjectUtils.GetGeometries(targetFeatures);

            SubcurveFilter.PrepareFilter(
                preprocessedSource, targetGeometries, useMinimalTolerance, filterOptions);

            foreach (IGeometry sourceGeometry in sourceGeometries)
            {
                Marshal.ReleaseComObject(sourceGeometry);
            }

            foreach (IGeometry targetGeometry in targetGeometries)
            {
                Marshal.ReleaseComObject(targetGeometry);
            }
        }