private IList <IntersectRecord> Calc4DLTB(IPolygon polygon)
        {
            var cursor = dltbFC.Search(
                new SpatialFilterClass()
            {
                Geometry = polygon, SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects
            },
                false);

            var pg5 = (IPolygon4)polygon;

            pg5.SimplifyEx(true, true, true);


            var to = (ITopologicalOperator)polygon;

            //to.IsKnownSimple = false;
            if (to.IsSimple == false)
            {
                to.Simplify();
            }

            var      index1  = cursor.FindField(DLBM_FIELD);
            var      index2  = cursor.FindField(QSBM_FIELD);
            var      list    = new List <IntersectRecord>();
            IFeature feature = cursor.NextFeature();

            while (feature != null)
            {
                IGeometry geo = feature.ShapeCopy;
                if (geo.IsEmpty == false)
                {
                    var geo2 = to.Intersect(geo, esriGeometryDimension.esriGeometry2Dimension);
                    var area = 0.0;
                    if (geo2 is IArea)
                    {
                        area = (geo2 as IArea).Area;
                    }

                    if (area > double.Epsilon)
                    {
                        var rec = new IntersectRecord()
                        {
                            DLBM  = feature.get_Value(index1).ToString(),
                            ZLBM  = feature.get_Value(index2).ToString(),
                            Value = area
                        };
                        list.Add(rec);
                    }
                }

                feature = cursor.NextFeature();
            }

            Marshal.ReleaseComObject(cursor);
            return(list);
        }
        private IList <IntersectRecord> Calc4LXDW(IPolygon polygon)
        {
            var cursor = lxdwFC.Search(
                new SpatialFilterClass()
            {
                Geometry = polygon, SpatialRel = esriSpatialRelEnum.esriSpatialRelContains
            },
                false);

            var index1 = cursor.FindField(DLBM_FIELD);
            var index2 = cursor.FindField(QSBM_FIELD);
            var index3 = cursor.FindField(LWMJ_FIELD);

            var      list    = new List <IntersectRecord>();
            IFeature feature = cursor.NextFeature();

            while (feature != null)
            {
                var geo = feature.ShapeCopy;
                if (geo.IsEmpty == false)
                {
                    var rec = new IntersectRecord()
                    {
                        DLBM  = feature.get_Value(index1).ToString(),
                        ZLBM  = feature.get_Value(index2).ToString(),
                        Value = double.Parse(feature.get_Value(index3).ToString())
                    };
                    list.Add(rec);
                }

                feature = cursor.NextFeature();
            }

            Marshal.ReleaseComObject(cursor);
            return(list);
        }
        private IList <IntersectRecord> Calc4XZDW(IPolygon polygon)
        {
            var cursor = xzdwFC.Search(
                new SpatialFilterClass()
            {
                Geometry = polygon, SpatialRel = esriSpatialRelEnum.esriSpatialRelEnvelopeIntersects
            },
                false);

            var to = (ITopologicalOperator)polygon;

            var index1 = cursor.FindField(DLBM_FIELD);

            var index3 = cursor.FindField(XWKD_FIELD);
            var index2 = cursor.FindField(QSBM_FIELD + "1");
            var index4 = cursor.FindField(QSBM_FIELD + "2");
            var list   = new List <IntersectRecord>();

            var exteriorRings = PolygonRingsToPolylines(polygon);

            IFeature feature = cursor.NextFeature();

            while (feature != null)
            {
                IGeometry geo = feature.ShapeCopy;
                if (geo.IsEmpty == false)
                {
                    geo.SpatialReference = polygon.SpatialReference;
                    var geo2   = to.Intersect(geo, esriGeometryDimension.esriGeometry1Dimension);
                    var length = CalcLength(geo2);

                    var width = double.Parse(feature.get_Value(index3).ToString());
                    var area  = length * width;
                    length = .0;
                    foreach (var ring in exteriorRings)
                    {
                        var geo3 = (ring as ITopologicalOperator).Intersect(geo2,
                                                                            esriGeometryDimension.esriGeometry1Dimension);
                        length += CalcLength(geo3);
                    }

                    area = area - length * width * 0.5;
                    if (area > double.Epsilon)
                    {
                        if (feature.get_Value(index4) == null || (feature.get_Value(index4) is DBNull) ||
                            string.IsNullOrEmpty(feature.get_Value(index4).ToString().Trim()))
                        {
                            var rec = new IntersectRecord()
                            {
                                DLBM  = feature.get_Value(index1).ToString(),
                                ZLBM  = feature.get_Value(index2).ToString(),
                                Value = area
                            };
                            list.Add(rec);
                        }
                        else
                        {
                            var rec = new IntersectRecord()
                            {
                                DLBM  = feature.get_Value(index1).ToString(),
                                ZLBM  = feature.get_Value(index2).ToString(),
                                Value = area * 0.5
                            };
                            list.Add(rec);

                            rec = new IntersectRecord()
                            {
                                DLBM  = feature.get_Value(index1).ToString(),
                                ZLBM  = feature.get_Value(index4).ToString(),
                                Value = area * 0.5
                            };
                            list.Add(rec);
                        }
                    }
                }

                feature = cursor.NextFeature();
            }

            Marshal.ReleaseComObject(cursor);
            return(list);
        }