/// <summary>
 /// Converts an Esri enumerable interface to a DotNet IEnumerable.
 /// </summary>
 /// <param name="esriEnum">An enumerable Esri interface.</param>
 /// <returns>The adapted dotnet enumeration.</returns>
 public static IEnumerable <int> Enumerate(this IEnumNetEID esriEnum)
 {
     esriEnum.Reset();
     for (int item = esriEnum.Next(); item > 0; item = esriEnum.Next())
     {
         yield return(item);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Creates an <see cref="IEnumerable{T}" /> from an <see cref="IEnumNetEID" />
        /// </summary>
        /// <param name="source">An <see cref="IEnumNetEID" /> to create an <see cref="IEnumerable{T}" /> from.</param>
        /// <returns>An <see cref="IEnumerable{T}" /> that contains the datasets from the input source.</returns>
        public static IEnumerable <int> AsEnumerable(this IEnumNetEID source)
        {
            if (source != null)
            {
                source.Reset();
                int eid = source.Next();
                while (eid != 0)
                {
                    yield return(eid);

                    eid = source.Next();
                }
            }
        }
Exemplo n.º 3
0
        private void DrawTraceRsult(IEnumNetEID JunctionEIDs, IEnumNetEID EdgEIDs)
        {
            if (JunctionBarrierEIDs == null || EdgEIDs == null)
            {
                return;
            }
            INetElements netElements = m_GeometryNetwork.Network as INetElements;
            int          userClssID  = -1;
            int          userID      = -1;
            int          userSubID   = -1;
            int          eid         = -1;
            //
            IFeatureClass fteClss;
            IFeature      feature;
            //设置管点和管线显示的Symbol
            ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass();

            simpleMarkerSymbol.Color = Method.Getcolor(255, 0, 0);
            simpleMarkerSymbol.Size  = 6;
            simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;
            ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();

            simpleLineSymbol.Color = Method.Getcolor(255, 0, 0);
            simpleLineSymbol.Width = 2;
            simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
            IElement element;

            //获取管点结果
            for (int i = 0; i < JunctionEIDs.Count; i++)
            {
                eid = JunctionEIDs.Next();
                netElements.QueryIDs(eid, esriElementType.esriETJunction, out userClssID, out userID, out userSubID);
                fteClss = GetFteClssByID(userClssID, this.Mapcontrol.Map);
                if (fteClss != null)
                {
                    feature          = fteClss.GetFeature(userID);
                    element          = new MarkerElementClass();
                    element.Geometry = feature.Shape;
                    ((IMarkerElement)element).Symbol   = simpleMarkerSymbol;
                    ((IElementProperties)element).Name = "Result";
                    this.Mapcontrol.ActiveView.GraphicsContainer.AddElement(element, 0);
                }
            }
            //获取管线结果
            for (int j = 0; j < EdgEIDs.Count; j++)
            {
                eid = EdgEIDs.Next();
                netElements.QueryIDs(eid, esriElementType.esriETEdge, out userClssID, out userID, out userSubID);
                fteClss = GetFteClssByID(userClssID, this.Mapcontrol.Map);
                if (fteClss != null)
                {
                    feature          = fteClss.GetFeature(userID);
                    element          = new LineElementClass();
                    element.Geometry = feature.Shape;
                    ((ILineElement )element).Symbol    = simpleLineSymbol;
                    ((IElementProperties)element).Name = "Result";
                    this.Mapcontrol.ActiveView.GraphicsContainer.AddElement(element, 0);
                }
            }
        }
        protected override void OnUpdate()
        {
            // by default, disable the command
            Enabled = false;

            // if there is not a current edit session, then disable the command
            if (m_editorExt.EditState != esriEditState.esriStateEditing)
            {
                return;
            }

            // otherwise, check to see if the flow direction is properly set for each edge EID
            IUtilityNetwork utilNet  = GetCurrentNetwork() as IUtilityNetwork;
            IEnumNetEID     edgeEIDs = GetCurrentEIDs(esriElementType.esriETEdge);

            edgeEIDs.Reset();
            for (int i = 0; i < edgeEIDs.Count; i++)
            {
                int edgeEID = edgeEIDs.Next();
                esriFlowDirection flowDir = utilNet.GetFlowDirection(edgeEID);
                if (flowDir != esriFlowDirection.esriFDWithFlow)
                {
                    // enable the command if the flow direction is not with the digitized direction
                    Enabled = true;

                    // we can return right now, since only one edge needs to have
                    // incorrect flow direction in order to enable the command
                    return;
                }
            }
        }
        protected override void OnClick()
        {
            // get the current network
            IUtilityNetwork utilNet = GetCurrentNetwork() as IUtilityNetwork;

            // create an edit operation enabling an undo for this operation
            m_editorExt.StartOperation();

            // get a list of the current EIDs for edges in the network
            IEnumNetEID edgeEIDs = GetCurrentEIDs(esriElementType.esriETEdge);

            // set the flow direction for each edge in the network
            edgeEIDs.Reset();
            for (int i = 0; i < edgeEIDs.Count; i++)
            {
                int edgeEID = edgeEIDs.Next();
                utilNet.SetFlowDirection(edgeEID, esriFlowDirection.esriFDWithFlow);
            }

            // stop the edit operation, specifying a name for this operation
            m_editorExt.StopOperation("Set Flow Direction");

            // refresh the display to update the flow direction arrows
            IActiveView mapView = ArcMap.Document.ActiveView;

            mapView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
        }
Exemplo n.º 6
0
        private Dictionary <IPoint, int> _ExtractUpstreamPipeEnds()
        {
            int iInletClassID = _inletClass.FeatureClassID;

            INetwork     network     = _geometricNetwork.Network;
            INetElements netElements = network as INetElements;
            INetTopology netTopology = network as INetTopology;

            Dictionary <IPoint, int> endPoints = new Dictionary <IPoint, int>();

            IEnumNetEID netEnum = network.CreateNetBrowser(esriElementType.esriETJunction);
            int         junctionCount = netEnum.Count;
            int         classId, userId, subId, edgeId;
            bool        towardJunction;
            int         junctionId = -1;

            for (int j = 0; j < junctionCount; j++)
            {
                junctionId = netEnum.Next();

                netElements.QueryIDs(junctionId, esriElementType.esriETJunction, out classId, out userId, out subId);

                if (classId != iInletClassID)
                {
                    bool disabled = false;
                    if (_excludeDisabled)
                    {
                        disabled = _IsDisabled(junctionId, esriElementType.esriETJunction, netElements);
                    }

                    if (!(_excludeDisabled && disabled))
                    {
                        int  edgeCount     = netTopology.GetAdjacentEdgeCount(junctionId);
                        bool isUpstreamEnd = edgeCount > 0; // initializing only (zero edge count always excluded)
                        for (int e = 0; e < edgeCount; e++)
                        {
                            netTopology.GetAdjacentEdge(junctionId, e, out edgeId, out towardJunction);
                            if (towardJunction)
                            {
                                isUpstreamEnd = false;
                                break;
                            }
                        }
                        if (isUpstreamEnd)
                        {
                            endPoints.Add(_geometricNetwork.get_GeometryForJunctionEID(junctionId) as IPoint, junctionId);
                        }
                    }
                }
            }

            return(endPoints);
        }
Exemplo n.º 7
0
        private void method_4(INetwork network)
        {
            IUtilityNetwork utilityNetwork = (IUtilityNetwork)network;
            IEnumNetEID     enumNetEID     = network.CreateNetBrowser((esriElementType)2);

            enumNetEID.Reset();
            long num  = (long)enumNetEID.Count;
            int  num2 = 0;

            while ((long)num2 < num)
            {
                int num3 = enumNetEID.Next();
                utilityNetwork.SetFlowDirection(num3, (esriFlowDirection)1);
                num2++;
            }
        }
Exemplo n.º 8
0
        //��˷׷�ٲ��ҹ����漰�ĵؿ�
        public static void UpStreamFindParcels(AxMapControl ppAxMapControl, IEnumNetEID pEnumResultEdges, IGeometricNetwork pGeoNetwork)
        {
            try
            {

                IFeatureLayer pFeatLayerSewerLines = FindFeatLayer("Sewer Lines", ppAxMapControl);
                IFeatureLayer pFeatLayerParcels = FindFeatLayer("Parcels", ppAxMapControl);
                //����ѡ���Sewer�������д������ΰ�

                IGeometryCollection pGeomBag = new GeometryBagClass();
                object missing = Type.Missing;
                int lEID;
                int iUserClassID;
                int iUserID;
                int iUserSubID;
                INetElements pNetElements = pGeoNetwork.Network as INetElements;
                pEnumResultEdges.Reset();
                IFeature pFeature;

                for (int j = 0; j <= pEnumResultEdges.Count - 1; j++)
                {
                    lEID = pEnumResultEdges.Next();
                    pNetElements.QueryIDs(lEID, esriElementType.esriETEdge, out iUserClassID, out iUserID, out iUserSubID);
                    pFeature = pFeatLayerSewerLines.FeatureClass.GetFeature(iUserID);
                    pGeomBag.AddGeometry(pFeature.Shape, ref missing, ref missing);
                    // MessageBox.Show(iUserClassID.ToString()+","+iUserID.ToString()+","+iUserSubID.ToString());
                }
                //���пռ����˵��Ӳ��������ڲ��ҵؿ���Ϣ
                ISpatialFilter pSpatialFilter = new SpatialFilterClass();
                pSpatialFilter.Geometry = pGeomBag as IGeometry;
                pSpatialFilter.GeometryField = "Shape";
                pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
                pSpatialFilter.SearchOrder = esriSearchOrder.esriSearchOrderSpatial;

                //��ý��浽�ĵؿ���Ϣ
                IFeatureCursor pFeatCursor = pFeatLayerParcels.FeatureClass.Search(pSpatialFilter, false);
                //���ӱ�ѡ��ĵؿ����ݵ���ͼ��ͼ��ͼ��������
                ICompositeGraphicsLayer pComGraphicLayer = new CompositeGraphicsLayerClass();
                ILayer pLayer = pComGraphicLayer as ILayer;
                pLayer.Name = "��Ӱ��ĵؿ�";
                IGraphicsContainer pGraphicContainer = pComGraphicLayer as IGraphicsContainer;
                //������ѡ��ĵؿ鵽ͼ��������
                ISimpleFillSymbol pSymFill = new SimpleFillSymbolClass();
                IFillSymbol pFillSymbol = pSymFill as IFillSymbol;
                IRgbColor pRgbColor = new RgbColorClass();
                pRgbColor.Red = 0;
                pRgbColor.Green = 200;
                pRgbColor.Blue = 100;
                pFillSymbol.Color = pRgbColor as IColor;
                ICartographicLineSymbol pCartoLine = new CartographicLineSymbolClass();
                IRgbColor pRgbColor2 = new RgbColorClass();
                pRgbColor2.Red = 100;
                pRgbColor2.Green = 200;
                pRgbColor2.Blue = 100;
                pCartoLine.Width = 2;
                pCartoLine.Color = pRgbColor2 as IColor;
                pFillSymbol.Outline = pCartoLine;
                //����������еؿ�����������
                IArray pFeatArray = new ArrayClass();
                pFeature = pFeatCursor.NextFeature();
                while (pFeature != null)
                {
                    IElement pPolyElement = new PolygonElementClass();
                    IFillShapeElement pFillShapeElement = pPolyElement as IFillShapeElement;
                    pPolyElement.Geometry = pFeature.Shape;
                    pFillShapeElement.Symbol = pFillSymbol;
                    pGraphicContainer.AddElement(pPolyElement, 0);
                    pFeatArray.Add(pFeature);
                    pFeature = pFeatCursor.NextFeature();
                }
                ppAxMapControl.AddLayer(pGraphicContainer as ILayer);
                ppAxMapControl.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
                //ma
                //frmUpstreamCreateOwnerList frmUpstreamCreateOwnerList1 = new frmUpstreamCreateOwnerList(ppAxMapControl,pFeatLayerParcels, pFeatArray);
                //frmUpstreamCreateOwnerList1.Show();
            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.Message);

            }
        }
Exemplo n.º 9
0
        public void GetFlow(IMap pMap)
        {
            int num4;

            this.m_pPointcol = new MultipointClass();
            this.m_eFlowDirection.Clear();
            this.m_angle.Clear();
            INetwork        network  = NetworkAnalyst.m_pAnalystGN.Network;
            IUtilityNetwork network2 = network as IUtilityNetwork;
            IEnumNetEID     netEIDs  = network.CreateNetBrowser(esriElementType.esriETEdge);
            IEnumNetEID     teid2    = network.CreateNetBrowser(esriElementType.esriETJunction);

            netEIDs.Reset();
            int        count  = netEIDs.Count;
            int        num2   = teid2.Count;
            IEIDHelper helper = new EIDHelperClass
            {
                GeometricNetwork       = NetworkAnalyst.m_pAnalystGN,
                OutputSpatialReference = pMap.SpatialReference,
                ReturnGeometries       = true,
                ReturnFeatures         = true
            };
            IEnumEIDInfo info = helper.CreateEnumEIDInfo(teid2);
            int          num3 = info.Count;

            teid2.Reset();
            info.Reset();
            IPointCollection points = new MultipointClass();
            object           before = Missing.Value;

            for (num4 = 0; num4 < num2; num4++)
            {
                IPoint inPoint = info.Next().Geometry as IPoint;
                points.AddPoint(inPoint, ref before, ref before);
            }
            info = null;
            info = helper.CreateEnumEIDInfo(netEIDs);
            num3 = info.Count;
            netEIDs.Reset();
            info.Reset();
            IList list  = new ArrayList();
            ILine line  = new LineClass();
            IList list2 = new ArrayList();
            int   num5  = 0;

            for (num4 = 0; num4 < count; num4++)
            {
                int edgeEID = netEIDs.Next();
                this.m_eFlowDirection.Add(network2.GetFlowDirection(edgeEID));
                IEIDInfo         info2         = info.Next();
                IGeometry        geometry      = info2.Geometry;
                IEdgeFeature     feature       = info2.Feature as IEdgeFeature;
                IPointCollection points2       = geometry as IPointCollection;
                int                 pointCount = points2.PointCount;
                IPoint              other      = new PointClass();
                IPoint[]            pointArray = new IPoint[pointCount];
                IRelationalOperator @operator  = points as IRelationalOperator;
                IPointCollection    points3    = new MultipointClass();
                int                 num8       = 0;
                for (int i = 0; i < pointCount; i++)
                {
                    other = points2.get_Point(i);
                    if (@operator.Contains(other))
                    {
                        IPoint point3 = points2.get_Point(i);
                        points3.AddPoint(point3, ref before, ref before);
                        pointArray[i] = point3;
                    }
                    else
                    {
                        pointArray[i] = null;
                    }
                }
                IPoint[] pointArray2 = new IPoint[pointCount];
                num8 = points3.PointCount;
                int index = -1;
                if (num5 < (points3.PointCount - 1))
                {
                    for (int j = 0; j < pointCount; j++)
                    {
                        if (pointArray[j] != null)
                        {
                            index++;
                        }
                        if (index == num5)
                        {
                            index = j;
                            break;
                        }
                    }
                    IPoint point4 = new PointClass();
                    pointArray2[index]     = pointArray[index];
                    pointArray2[index + 1] = points2.get_Point(index + 1);
                    point4.X = (pointArray2[index].X + pointArray2[index + 1].X) / 2.0;
                    point4.Y = (pointArray2[index].Y + pointArray2[index + 1].Y) / 2.0;
                    this.m_pPointcol.AddPoint(point4, ref before, ref before);
                    line.FromPoint = pointArray2[index];
                    line.ToPoint   = pointArray2[index + 1];
                    this.m_angle.Add(line.Angle);
                    num5++;
                    if (num5 == (num8 - 1))
                    {
                        num5 = 0;
                    }
                }
            }
            this.ShowFlow(pMap as IActiveView);
        }
        /// <summary>
        /// operation solve trace
        /// </summary>
        /// <returns>solve trace</returns>
        public override JsonObject Solve()
        {
            try
            {
                if ((this.edgeFlags.Length == 0) && (this.junctionFlags.Length == 0))
                {
                    string message = "No input valid flags found";
                    if (this.flagNotFound.Count == 0)
                    {
                        throw new GeometricNetworkException(message);
                    }
                    else
                    {
                        JsonObject error = (new ObjectError(message)).ToJsonObject();
                        error.AddArray("flagsNotFound", Helper.GetListJsonObjects(this.flagNotFound));
                        if (this.barrierNotFound.Count > 0)
                        {
                            error.AddArray("barriersNotFound", Helper.GetListJsonObjects(this.barrierNotFound));
                        }

                        return(error);
                    }
                }

                ITraceFlowSolverGEN traceFlowSolver = new TraceFlowSolverClass() as ITraceFlowSolverGEN;
                INetSolver          netSolver       = traceFlowSolver as INetSolver;
                INetwork            network         = this.geometricNetwork.Network;
                netSolver.SourceNetwork = network;

                // flag origin
                this.SetFlagsOrigin(ref traceFlowSolver);

                // barrier
                this.SetBarriers(ref traceFlowSolver);

                // set disabled layers
                foreach (int i in this.DisableLayers)
                {
                    netSolver.DisableElementClass(i);
                }

                // set weight
                this.SetWeights(ref traceFlowSolver);

                if ((this.TraceSolverType != TraceSolverType.FindCircuits) && (this.TraceSolverType != TraceSolverType.FindCommonAncestors))
                {
                    // The TraceIndeterminateFlow property affects the trace results of trace solvers whose FlowMethod parameter is esriFMUpstream or esriFMDownstream
                    if ((this.FlowMethod == esriFlowMethod.esriFMDownstream) || (this.FlowMethod == esriFlowMethod.esriFMUpstream))
                    {
                        traceFlowSolver.TraceIndeterminateFlow = this.TraceIndeterminateFlow;
                    }
                }

                IEnumNetEID junctionEIDs = null;
                IEnumNetEID edgeEIDs     = null;
                object      totalCost;
                int         count;
                object[]    segmentCosts;

                JsonObject objectJson = new JsonObject();
                switch (this.TraceSolverType)
                {
                case TraceSolverType.FindAccumulation:
                    traceFlowSolver.FindAccumulation(this.FlowMethod, this.FlowElements, out junctionEIDs, out edgeEIDs, out totalCost);
                    objectJson.AddDouble("totalCost", (double)totalCost);
                    break;

                case TraceSolverType.FindCircuits:
                    traceFlowSolver.FindCircuits(this.FlowElements, out junctionEIDs, out edgeEIDs);
                    break;

                case TraceSolverType.FindCommonAncestors:
                    traceFlowSolver.FindCommonAncestors(this.FlowElements, out junctionEIDs, out edgeEIDs);
                    break;

                case TraceSolverType.FindFlowElements:
                    traceFlowSolver.FindFlowElements(this.FlowMethod, this.FlowElements, out junctionEIDs, out edgeEIDs);
                    break;

                case TraceSolverType.FindFlowEndElements:
                    traceFlowSolver.FindFlowEndElements(this.FlowMethod, this.FlowElements, out junctionEIDs, out edgeEIDs);
                    break;

                case TraceSolverType.FindFlowUnreachedElements:
                    traceFlowSolver.FindFlowUnreachedElements(this.FlowMethod, this.FlowElements, out junctionEIDs, out edgeEIDs);
                    break;

                case TraceSolverType.FindPath:
                    count = Math.Max(this.junctionFlags.Length, this.edgeFlags.Length);
                    if (count < 2)
                    {
                        throw new GeometricNetworkException("Edge or junction found < 2!");
                    }

                    --count;
                    segmentCosts = new object[count];
                    traceFlowSolver.FindPath(this.FlowMethod, this.ShortestPathObjFn, out junctionEIDs, out edgeEIDs, count, ref segmentCosts);
                    objectJson.AddArray("segmentCosts", segmentCosts);
                    break;

                case TraceSolverType.FindSource:
                    count        = this.junctionFlags.Length + this.edgeFlags.Length;
                    segmentCosts = new object[count];
                    traceFlowSolver.FindSource(this.FlowMethod, this.ShortestPathObjFn, out junctionEIDs, out edgeEIDs, count, ref segmentCosts);
                    objectJson.AddArray("segmentCosts", segmentCosts);
                    break;

                case TraceSolverType.FindLongest:
                    // get end junctions in upstream
                    IEnumNetEID junctionEIDsFindLongest = null;
                    IEnumNetEID edgeEIDsFindLongest     = null;
                    traceFlowSolver.FindFlowEndElements(esriFlowMethod.esriFMUpstream, esriFlowElements.esriFEJunctions, out junctionEIDsFindLongest, out edgeEIDsFindLongest);

                    int?   eidLongest       = null;
                    double eidLongestLenght = double.MinValue;

                    if (junctionEIDsFindLongest.Count > 0)
                    {
                        double eidLongestLenghtCurrent = double.NaN;
                        for (int i = 0; i < junctionEIDsFindLongest.Count; i++)
                        {
                            int         netEIDCurrent       = junctionEIDsFindLongest.Next();
                            object[]    segmentLenghts      = new object[1];
                            IEnumNetEID junctionEIDsLongest = null;
                            IEnumNetEID edgeEIDsLongest     = null;

                            INetFlag     netFlag = new JunctionFlagClass();
                            INetElements netElements = this.geometricNetwork.Network as INetElements;
                            int          featureClassID, featureID, subID;
                            netElements.QueryIDs(netEIDCurrent, esriElementType.esriETJunction, out featureClassID, out featureID, out subID);

                            netFlag.UserClassID = featureClassID;
                            netFlag.UserID      = featureID;
                            netFlag.UserSubID   = subID;

                            IJunctionFlag[] junctionFlags = new IJunctionFlag[] { this.junctionFlags[0], netFlag as IJunctionFlag };
                            traceFlowSolver.PutJunctionOrigins(ref junctionFlags);

                            traceFlowSolver.FindPath(esriFlowMethod.esriFMUpstream, esriShortestPathObjFn.esriSPObjFnMinMax, out junctionEIDsLongest, out edgeEIDsLongest, 1, ref segmentLenghts);
                            if (segmentLenghts[0] != null)
                            {
                                eidLongestLenghtCurrent = Convert.ToDouble(segmentLenghts[0]);
                                if (eidLongestLenghtCurrent > eidLongestLenght)
                                {
                                    eidLongestLenght = eidLongestLenghtCurrent;
                                    eidLongest       = netEIDCurrent;
                                    edgeEIDs         = edgeEIDsLongest;
                                    junctionEIDs     = junctionEIDsLongest;
                                }
                            }
                        }
                    }
                    else
                    {
                        throw new GeometricNetworkException("Junction end not found!");
                    }

                    if (eidLongest.HasValue)
                    {
                        objectJson.AddDouble("totalCost", eidLongestLenght);
                    }
                    else
                    {
                        throw new GeometricNetworkException("EID longest not found!");
                    }

                    break;

                default:
                    throw new GeometricNetworkException("Trace solver type not found");
                }

                this.SetResults(ref objectJson, edgeEIDs, junctionEIDs);
                objectJson.AddArray("flagsNotFound", Helper.GetListJsonObjects(this.flagNotFound));
                objectJson.AddArray("barriersNotFound", Helper.GetListJsonObjects(this.barrierNotFound));
                return(objectJson);
            }
            catch (Exception e)
            {
                return((new ObjectError(e.Message)).ToJsonObject());
            }
        }
Exemplo n.º 11
0
        //上朔追踪查找管线涉及的地块
        public static void UpStreamFindParcels(MainFrm pMainFrm, IEnumNetEID pEnumResultEdges, IGeometricNetwork pGeoNetwork)
        {
            try
            {
                AxMapControl axMap = pMainFrm.getMapControl();
                IFeatureLayer pFeatLayerSewerLines = FindFeatLayer("Sewer Lines", pMainFrm);
                IFeatureLayer pFeatLayerParcels = FindFeatLayer("Parcels", pMainFrm);
                //从所选择的Sewer线特征中创建几何包
               
                IGeometryCollection pGeomBag = new GeometryBagClass();
                object missing = Type.Missing;
                int lEID;
                int iUserClassID;
                int iUserID;
                int iUserSubID;
                INetElements pNetElements = pGeoNetwork.Network as INetElements;
                pEnumResultEdges.Reset();
                IFeature pFeature;

                for (int j = 0; j <= pEnumResultEdges.Count - 1; j++)
                {
                    lEID = pEnumResultEdges.Next();
                    pNetElements.QueryIDs(lEID, esriElementType.esriETEdge, out iUserClassID, out iUserID, out iUserSubID);
                    pFeature = pFeatLayerSewerLines.FeatureClass.GetFeature(iUserID);
                    pGeomBag.AddGeometry(pFeature.Shape, ref missing, ref missing);
                    // MessageBox.Show(iUserClassID.ToString()+","+iUserID.ToString()+","+iUserSubID.ToString());
                }                                
                                //进行空间拓扑叠加操作以用于查找地块信息
                ISpatialFilter pSpatialFilter = new SpatialFilterClass();
                pSpatialFilter.Geometry = pGeomBag as IGeometry ;
                pSpatialFilter.GeometryField = "Shape";
                pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;
                pSpatialFilter.SearchOrder = esriSearchOrder.esriSearchOrderSpatial;
                                
                
                //获得交叉到的地块信息
                 IFeatureCursor pFeatCursor=pFeatLayerParcels.FeatureClass.Search(pSpatialFilter, false);
                //增加被选择的地块数据到地图的图形图层数据中
                ICompositeGraphicsLayer pComGraphicLayer = new CompositeGraphicsLayerClass();
                ILayer pLayer = pComGraphicLayer as ILayer ;
                pLayer.Name = "受影响的地块";
                IGraphicsContainer pGraphicContainer = pComGraphicLayer as IGraphicsContainer;
                //增加所选择的地块到图形容器中
                ISimpleFillSymbol pSymFill=new SimpleFillSymbolClass();
                IFillSymbol pFillSymbol=pSymFill as IFillSymbol;
                IRgbColor pRgbColor=new RgbColorClass();
                pRgbColor.Red=0;
                pRgbColor.Green=200;
                pRgbColor.Blue=100;
                pFillSymbol.Color=pRgbColor as IColor;
                ICartographicLineSymbol pCartoLine=new CartographicLineSymbolClass();
                IRgbColor pRgbColor2=new RgbColorClass();
                pRgbColor2.Red=100;
                pRgbColor2.Green=200;
                pRgbColor2.Blue=100;
                pCartoLine.Width=2;
                pCartoLine.Color =pRgbColor2 as IColor;
                pFillSymbol.Outline=pCartoLine;
                //创建存放所有地块特征的数组
                IArray pFeatArray = new ArrayClass();
                pFeature=pFeatCursor.NextFeature();
                while (pFeature != null)
                {
                    IElement pPolyElement = new PolygonElementClass();
                    IFillShapeElement pFillShapeElement = pPolyElement as IFillShapeElement;
                    pPolyElement.Geometry = pFeature.Shape;
                    pFillShapeElement.Symbol = pFillSymbol;
                    pGraphicContainer.AddElement(pPolyElement, 0);
                    pFeatArray.Add(pFeature);
                    pFeature = pFeatCursor.NextFeature();
                }
                axMap.AddLayer(pGraphicContainer as ILayer);
                axMap.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics,null,null);
                frmUpstreamCreateOwnerList frmUpstreamCreateOwnerList1 = new frmUpstreamCreateOwnerList(pMainFrm,pFeatLayerParcels, pFeatArray);
                frmUpstreamCreateOwnerList1.Show();
            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.Message);

            }

        }