Beispiel #1
0
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            if (Button != 1)
            {
                return;
            }
            IPoint inPoint = new PointClass();

            inPoint = this.m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
            IMap map = this.m_hookHelper.FocusMap;
            //获取最邻近的要素ID
            IPointToEID pointToEID = new PointToEIDClass();

            pointToEID.GeometricNetwork = geometricNetwork;
            pointToEID.SourceMap        = map;
            pointToEID.SnapTolerance    = 10;
            int    nearstJunctionEID = -1;
            IPoint outPoint          = new PointClass();

            pointToEID.GetNearestJunction(inPoint, out nearstJunctionEID, out outPoint);
            if (outPoint == null || outPoint.IsEmpty)
            {
                return;
            }
            junctionBarrierEIDs.Add(nearstJunctionEID);
            //绘制要素
            DrawElement(outPoint);
        }
        /// <summary>
        /// 设置障碍点
        /// </summary>
        /// <param name="pNetSolver"></param>
        /// <param name="breakPoints"></param>
        /// <param name="pGeometricNet"></param>
        /// <param name="pDisc"></param>
        private void SetBarries(INetSolver pNetSolver, List <IPoint> breakPoints, IGeometricNetwork pGeometricNet, double pDisc)
        {
            INetwork     pNetwork     = pGeometricNet.Network;
            INetElements pNetElements = pNetwork as INetElements;
            IPointToEID  pPointToEID  = new PointToEIDClass();

            pPointToEID.GeometricNetwork = pGeometricNet;
            pPointToEID.SnapTolerance    = pDisc;
            ISelectionSetBarriers barriers = new SelectionSetBarriersClass();

            foreach (var point in breakPoints)
            {
                //寻找障碍点最近的线要素,从而添加爆管线
                int    nearEdgeID;
                IPoint outIpoint;
                double precent;
                pPointToEID.GetNearestEdge(point, out nearEdgeID, out outIpoint, out precent);
                int userClassID;
                int userID;
                int userSubID;
                //查询相关ID
                pNetElements.QueryIDs(nearEdgeID, esriElementType.esriETJunction, out userClassID, out userID, out userSubID);
                //添加障碍点
                barriers.Add(userClassID, userID);
            }
            pNetSolver.SelectionSetBarriers = barriers;
        }
Beispiel #3
0
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            if (Button != 1)
            {
                return;
            }
            IPoint inPoint = new PointClass();

            inPoint = this.m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
            //
            IPointToEID pointToEID = new PointToEIDClass();

            pointToEID.GeometricNetwork = geometricNetwork;
            pointToEID.SourceMap        = m_hookHelper.FocusMap;
            pointToEID.SnapTolerance    = 10;
            //
            int    nearestEID = -1;
            double percent    = -1;
            IPoint outPoint   = new PointClass();

            pointToEID.GetNearestEdge(inPoint, out nearestEID, out outPoint, out percent);
            //
            if (outPoint.IsEmpty || outPoint == null)
            {
                return;
            }
            edgeBarrierEIDs.Add(nearestEID);
            //绘制图形
            DrawElement(outPoint);
        }
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            base.OnMouseDown(Button, Shift, X, Y);
            if (Button != 1)
            {
                return;
            }
            //获取坐标点
            IPoint inPoint = new PointClass();

            inPoint = m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);

            IMap map = m_hookHelper.FocusMap;

            //查询与坐标点最近的管点
            IPointToEID pointToEID = new PointToEIDClass();

            //
            if (geomretyNetwork == null)
            {
                return;
            }
            pointToEID.GeometricNetwork = geomretyNetwork;
            pointToEID.SourceMap        = map;
            pointToEID.SnapTolerance    = 10;
            IPoint outPoint           = new PointClass();
            int    nearestJunctionEID = -1;

            pointToEID.GetNearestJunction(inPoint, out nearestJunctionEID, out outPoint);
            if (outPoint == null || outPoint.IsEmpty)
            {
                return;
            }
            //获取管点标识并加入列表
            INetElements netElemnts = geomretyNetwork.Network  as INetElements;

            int UserClassID = 0;
            int UserID      = 0;
            int UserSubID   = 0;

            netElemnts.QueryIDs(nearestJunctionEID, esriElementType.esriETJunction, out UserClassID, out UserID, out UserSubID);

            //设置并添加管点标识
            INetFlag netFlag = new JunctionFlagClass() as INetFlag;

            netFlag.UserClassID = UserClassID;
            netFlag.UserID      = UserID;
            netFlag.UserSubID   = UserSubID;
            //
            listJunctionFlags.Add(netFlag as IJunctionFlag);
            //绘制点要素
            DrawElement(outPoint);
        }
Beispiel #5
0
        public override void OnMouseDown(int Button, int Shift, int X, int Y)
        {
            if (Button != 1)
            {
                return;
            }
            IPoint inPoint = new PointClass();

            inPoint = this.m_hookHelper.ActiveView.ScreenDisplay.DisplayTransformation.ToMapPoint(X, Y);
            IMap map = this.m_hookHelper.FocusMap;

            //查询与点最近的EID
            IPointToEID pointToEID = new PointToEIDClass();

            pointToEID.GeometricNetwork = geometricNetwork;
            pointToEID.SourceMap        = map;
            pointToEID.SnapTolerance    = 10;

            IPoint outPoint      = new PointClass();
            int    nearestEdgeID = -1;
            double percent       = -1;

            pointToEID.GetNearestEdge(inPoint, out nearestEdgeID, out outPoint, out percent);

            if (outPoint == null || outPoint.IsEmpty)
            {
                return;
            }
            //获取与点最邻近的边
            INetElements netElments = geometricNetwork.Network as INetElements;
            int          userClSSID = 0;
            int          userID     = 0;
            int          userSubID  = 0;

            netElments.QueryIDs(nearestEdgeID, esriElementType.esriETEdge, out userClSSID, out userID, out userSubID);
            INetFlag netFlag = new EdgeFlagClass() as INetFlag;

            netFlag.UserClassID = userClSSID;
            netFlag.UserID      = userID;
            netFlag.UserSubID   = userSubID;
            //添加管线标识
            listEdgeFlag.Add(netFlag as IEdgeFlag);

            //绘制点所在的边
            DrawElement(outPoint);
        }
        /// <summary>
        /// 根据输入点建立旗帜数组
        /// </summary>
        /// <param name="pGeometricNet"></param>
        /// <param name="pCollection"></param>
        /// <param name="pDisc"></param>
        /// <param name="pNetElements"></param>
        /// <returns></returns>
        private static IJunctionFlag[] GetJunctionFlags(IMap pMap, IGeometricNetwork pGeometricNet, IPointCollection pCollection, double pDisc)
        {
            INetElements pNetElements = pGeometricNet.Network as INetElements;
            int          pCount       = pCollection.PointCount;

            IJunctionFlag[] pJunctionFlags = new JunctionFlagClass[pCount];
            IPointToEID     pPointToEID    = new PointToEIDClass();

            pPointToEID.SourceMap        = pMap;
            pPointToEID.GeometricNetwork = pGeometricNet;
            //从输入点找最近节点的距离阈值
            pPointToEID.SnapTolerance = pDisc;
            for (int i = 0; i < pCount; i++)
            {
                INetFlag pNetFlag   = new JunctionFlagClass();
                IPoint   pEdgePoint = pCollection.get_Point(i);
                #region 查找输入点最近的节点的ID
                int    nearestJunctionID;
                IPoint locationPoint;
                int    userClassID;
                int    userID;
                int    userSubID;
                pPointToEID.GetNearestJunction(pEdgePoint, out nearestJunctionID, out locationPoint);
                pNetElements.QueryIDs(nearestJunctionID, esriElementType.esriETJunction, out userClassID, out userID, out userSubID);
                #endregion
                //设置网络旗帜的节点的ID
                pNetFlag.UserClassID = userClassID;
                pNetFlag.UserID      = userID;
                pNetFlag.UserSubID   = userSubID;
                //节点旗帜
                IJunctionFlag pJuncF = pNetFlag as IJunctionFlag;
                //添加
                pJunctionFlags[i] = pJuncF;
            }
            return(pJunctionFlags);
        }
        public static void UpStreamTrace(AxMapControl ppAxMapControl, IPoint pPoint, IGeometricNetwork pGeoNetwork)
        {
            try
            {
                //�����ͼ��ѡ��
                ppAxMapControl.ActiveView.FocusMap.ClearSelection();
                INetElements pNetElements = pGeoNetwork.Network as INetElements;
                IPointToEID pPtToEID = new PointToEIDClass();
                int pJunctionID = 0;
                int iUserClassID;
                int iUserID;
                int iUserSubID;
                IPoint pLocation;

                pPtToEID.SourceMap = ppAxMapControl.ActiveView.FocusMap;
                pPtToEID.GeometricNetwork = pGeoNetwork;
                pPtToEID.SnapTolerance = ppAxMapControl.ActiveView.Extent.Envelope.Width / 100;
                pPtToEID.GetNearestJunction(pPoint, out pJunctionID, out pLocation);
                if (pJunctionID == 0)
                {
                    MessageBox.Show("û�в������ٽ��ĵ�");
                }
                else
                {
                    pNetElements.QueryIDs(pJunctionID, esriElementType.esriETJunction, out iUserClassID, out iUserID, out iUserSubID);
                    INetFlag ipNetFlag = new JunctionFlagClass();
                    ipNetFlag.UserClassID = iUserClassID;
                    ipNetFlag.UserID = iUserID;
                    ipNetFlag.UserSubID = iUserSubID;

                    IMarkerSymbol pMarkerSym = new SimpleMarkerSymbolClass();
                    IRgbColor pRGBColor = new RgbColorClass();
                    pRGBColor.Red = 255;
                    pRGBColor.Green = 0;
                    pRGBColor.Blue = 0;
                    pMarkerSym.Color = pRGBColor;
                    pMarkerSym.Size = 20;
                    //�����µ�Flag

                    IEdgeFlagDisplay pEdgeFlagDisplay = new EdgeFlagDisplayClass();
                    IFlagDisplay pFlagDisplay = pEdgeFlagDisplay as IFlagDisplay;
                    pFlagDisplay.Symbol = pMarkerSym as ISymbol;
                    pFlagDisplay.Geometry = pLocation;
                    pFlagDisplay.FeatureClassID = iUserClassID;
                    pFlagDisplay.FID = iUserID;
                    pFlagDisplay.SubID = iUserSubID;

                    //���Ƹõ�
                    IScreenDisplay pScreenDisplay = ppAxMapControl.ActiveView.ScreenDisplay;
                    pScreenDisplay.StartDrawing(pScreenDisplay.hDC, 0);
                    pScreenDisplay.SetSymbol(pMarkerSym as ISymbol);
                    pScreenDisplay.DrawPoint(pLocation as IGeometry);
                    pScreenDisplay.FinishDrawing();
                    //����׷�ٽ��
                    FindStreamTraceResult(ppAxMapControl, ipNetFlag, pGeoNetwork);
                }
            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.Message);

            }
        }
        //////////////////////////////////�����������ǰ���ý����С��
        public static void ProfileSetJunctionFlag(AxMapControl ppAxMapControl, ref IArray pNetFlagArray, IPoint pPoint, IGeometricNetwork pGeoNetwork)
        {
            try
            {

                //�����ͼ��ѡ��
                ppAxMapControl.ActiveView.FocusMap.ClearSelection();
                INetElements pNetElements = pGeoNetwork.Network as INetElements;
                IPointToEID pPtToEID = new PointToEIDClass();
                int pJunctionID = 0;
                int iUserClassID;
                int iUserID;
                int iUserSubID;
                IPoint pLocation;

                pPtToEID.SourceMap = ppAxMapControl.ActiveView.FocusMap;
                pPtToEID.GeometricNetwork = pGeoNetwork;
                pPtToEID.SnapTolerance = ppAxMapControl.ActiveView.Extent.Envelope.Width / 100;
                pPtToEID.GetNearestJunction(pPoint, out pJunctionID, out pLocation);
                if (pJunctionID == 0)
                {
                    MessageBox.Show("û�в������ٽ��ĵ�");
                }
                else
                {

                    pNetElements.QueryIDs(pJunctionID, esriElementType.esriETJunction, out iUserClassID, out iUserID, out iUserSubID);
                    INetFlag ipNetFlag = new JunctionFlagClass();
                    ipNetFlag.UserClassID = iUserClassID;
                    ipNetFlag.UserID = iUserID;
                    ipNetFlag.UserSubID = iUserSubID;

                    IMarkerSymbol pMarkerSym = new SimpleMarkerSymbolClass();
                    IRgbColor pRGBColor = new RgbColorClass();
                    pRGBColor.Red = 255;
                    pRGBColor.Green = 0;
                    pRGBColor.Blue = 0;
                    pMarkerSym.Color = pRGBColor;
                    pMarkerSym.Size = 20;
                    //���Ƹõ�
                    IScreenDisplay pScreenDisplay = ppAxMapControl.ActiveView.ScreenDisplay;
                    pScreenDisplay.StartDrawing(pScreenDisplay.hDC, 0);
                    pScreenDisplay.SetSymbol(pMarkerSym as ISymbol);
                    pScreenDisplay.DrawPoint(pLocation);
                    pScreenDisplay.FinishDrawing();
                    if (pLocation != null)
                    {
                        pNetFlagArray.Add(ipNetFlag);
                    }
                    if (pNetFlagArray.Count == 2)
                    {

                        //����׷�ٽ��
                        ProfileFindPath(ppAxMapControl, pNetFlagArray, pGeoNetwork);
                    }
                }

            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.Message);

            }
        }
        public static void CalculateFlowAccumAtLocation(List<FlowLayerDetails> sumFlowAcc, IApplication app, double snapTol)
        {
            IMap pMap = null;

            IFeatureLayer pFLayer = null;

            IFeatureCursor pFCursor = null;
            IFeature pFeature = null;

            IPointToEID pPointToEid = null;

            string retAcc = "";
            int lSumFieldLoc;

            int lEID;
            IPoint pSnappedPoint = null;
            INetElements pNetElements = null;
            try
            {
                if (app == null)
                    return;
                pMap = ((app.Document as IMxDocument).FocusMap);
                if (pMap == null)
                    return;
                if (sumFlowAcc == null)
                    MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_20c"));
                if (sumFlowAcc.Count == 0)
                    MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_20c"));
                bool flowCalced = false;
                foreach (FlowLayerDetails sumAcc in sumFlowAcc)
                {
                    if (flowCalced == true)
                        break;

                    bool boolFoundAsLayer = true;

                    pFLayer = Globals.FindLayer(app, sumAcc.LayerName, ref boolFoundAsLayer) as IFeatureLayer;
                    if (pFLayer == null)
                    {
                        //MessageBox.Show(sumAcc.LayerName + " feature layer not found.\nAny selected features in this layer will be analyzed for acculmuation.");
                        continue;
                    }

                    if (pFLayer.FeatureClass == null)
                    {
                        MessageBox.Show(sumAcc.LayerName + A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_20a"));
                        continue;
                    }

                    lSumFieldLoc = pFLayer.FeatureClass.Fields.FindField(sumAcc.SumFlowField);
                    if (lSumFieldLoc == -1)
                    {
                        MessageBox.Show(sumAcc.LayerName + A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_20b") + sumAcc.SumFlowField + A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_20e"));
                        return;
                    }

                    lEID = -1;
                    //Convert pixcel search distance to real world (map units)
                    //dRWSearchTolerance = c_iSearchTolerance;

                    //Find the closest network junction element to the user specified point

                    pPointToEid = new PointToEIDClass();
                    pPointToEid.GeometricNetwork = ((INetworkClass)pFLayer.FeatureClass).GeometricNetwork;
                    pPointToEid.SourceMap = pMap;
                    pPointToEid.SnapTolerance = snapTol;
                    bool bTest = false;
                    if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline || pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryLine)
                    {
                        double dblPercAlong = 0;

                        pPointToEid.GetNearestEdge((app.Document as IMxDocument).CurrentLocation, out lEID, out pSnappedPoint, out dblPercAlong);

                        if (pSnappedPoint == null)
                            continue;
                        if (lEID == 0)
                            continue;
                        //Get the complete id for the network element
                        pNetElements = (((INetworkClass)pFLayer.FeatureClass).GeometricNetwork.Network) as INetElements;

                        bTest = pNetElements.IsValidElement(lEID, esriElementType.esriETEdge);
                        pFeature = Globals.GetFeatureByEID(lEID, ((INetworkClass)pFLayer.FeatureClass).GeometricNetwork, pMap, esriElementType.esriETEdge);
                    }
                    else if (pFLayer.FeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)
                    {
                        pPointToEid.GetNearestJunction((app.Document as IMxDocument).CurrentLocation, out lEID, out pSnappedPoint);

                        if (pSnappedPoint == null)
                            continue;
                        if (lEID == 0)
                            continue;
                        //Get the complete id for the network element
                        pNetElements = (((INetworkClass)pFLayer.FeatureClass).GeometricNetwork.Network) as INetElements;

                        bTest = pNetElements.IsValidElement(lEID, esriElementType.esriETJunction);
                        pFeature = Globals.GetFeatureByEID(lEID, ((INetworkClass)pFLayer.FeatureClass).GeometricNetwork, pMap, esriElementType.esriETJunction);
                    }
                    if (bTest && pFeature != null)
                    {

                        retAcc = Globals.ReturnAccumulation(ref app, ref pFeature, sumAcc.WeightName, sumAcc.FlowDirection);
                        if (Globals.IsNumeric(retAcc))
                        {
                            MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsMess_20b") + pFeature.OID + A4LGSharedFunctions.Localizer.GetString("In") + pFLayer.Name + A4LGSharedFunctions.Localizer.GetString("Is") + retAcc + ".");
                            //pFeature.set_Value(lSumFieldLoc, retAcc);
                            //pFeature.Store();
                        }
                    }
                    flowCalced =true;

                }

                if (flowCalced == false)
                    MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("GeoNetToolsError_20f"));

            }
            catch (Exception ex)
            {
                MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("ErrorInThe") + A4LGSharedFunctions.Localizer.GetString("GeoNetToolsLbl_20a") + "\n" + ex.Message);
            }
            finally
            {

                pMap = null;
                pFLayer = null;
                if (pFCursor != null)
                    Marshal.ReleaseComObject(pFCursor);
                pFCursor = null;
                pFeature = null;

                pSnappedPoint = null;
                pNetElements = null;
            }
        }
Beispiel #10
0
        private void StartAnalysis(IFeature feature)
        {
            if (feature.FeatureType != esriFeatureType.esriFTSimpleJunction)
            {
                MessageService.Current.Warn("请选择管线点");
                return;
            }
            if (!_pipelineConfig.IsPipelineLayer(feature.Class.AliasName, enumPipelineDataType.Point))
            {
                MessageService.Current.Warn("请选择管线点");
                return;
            }
            double snapDist = CommonUtils.ConvertPixelsToMapUnits(_context.ActiveView,
                                                                  _context.Config.SnapTolerance);
            IBasicLayerInfo lineConfig =
                _plugin.PipeConfig.GetBasicLayerInfo(feature.Class as IFeatureClass) as IBasicLayerInfo;

            if (this._startPoint == null && _startEid == 0)
            {
                //开始记录起始点
                IPipelineLayer oldLayer = _pipelineConfig.GetPipelineLayer(feature.Class.AliasName,
                                                                           enumPipelineDataType.Point);
                if (oldLayer == null)
                {
                    MessageService.Current.Warn("你选择的图层不是合法的管线图层!");
                    return;
                }
                List <IBasicLayerInfo> basicInfos = oldLayer.GetLayers(enumPipelineDataType.Junction);

                IFeatureClass featureClass = basicInfos.Count > 0 ? basicInfos[0].FeatureClass : null;
                if (featureClass == null)
                {
                    MessageService.Current.Warn("管线图层没有构建网络图层!");
                    return;
                }
                INetworkClass networkClass = featureClass as INetworkClass;
                _geometricNetwork = networkClass.GeometricNetwork;
                IPointToEID pnToEid = new PointToEIDClass();
                pnToEid.GeometricNetwork = _geometricNetwork;
                pnToEid.SnapTolerance    = snapDist;
                pnToEid.SourceMap        = _context.FocusMap;
                pnToEid.GetNearestJunction(feature.Shape as IPoint, out _startEid, out _startPoint);
                return;
            }
            IPipelineLayer newLayer = _pipelineConfig.GetPipelineLayer(feature.Class.AliasName,
                                                                       enumPipelineDataType.Point);

            if (newLayer == null)
            {
                MessageService.Current.Warn("你选择的图层不是合法的管线图层!");
                return;
            }
            List <IBasicLayerInfo> basicInfos1 = newLayer.GetLayers(enumPipelineDataType.Junction);

            IFeatureClass featureClass2 = basicInfos1.Count > 0 ? basicInfos1[0].FeatureClass : null;

            if (featureClass2 == null)
            {
                MessageService.Current.Warn("第二个管线图层没有构建网络图层!");
                return;
            }
            INetworkClass networkClass2 = featureClass2 as INetworkClass;

            if (networkClass2.GeometricNetwork != _geometricNetwork)
            {
                if (MessageService.Current.Ask("两个点位属于不同的网络图层,使用第二个网络图层作为分析图层吗?") == false)
                {
                    return;
                }
                _geometricNetwork = networkClass2.GeometricNetwork;
                IPointToEID pnToEid = new PointToEIDClass();
                pnToEid.GeometricNetwork = _geometricNetwork;
                pnToEid.SnapTolerance    = snapDist;
                pnToEid.SourceMap        = _context.FocusMap;
                pnToEid.GetNearestJunction(feature.Shape as IPoint, out _startEid, out _startPoint);
                return;
            }

            try
            {
                IPointToEID pntEid = new PointToEIDClass();
                pntEid.GeometricNetwork = _geometricNetwork;
                pntEid.SourceMap        = _context.FocusMap;
                pntEid.SnapTolerance    = snapDist;

                pntEid.GetNearestJunction(feature.Shape as IPoint, out _endEid, out _endPoint);
                if (_endEid < 1)
                {
                    MessageService.Current.Warn("未能找到第二个分析点!");
                    return;
                }
                if (_startEid == _endEid)
                {
                    MessageService.Current.Warn("起点终点为同一个点!");
                    return;
                }

                INetElements  netElements  = _geometricNetwork.Network as INetElements;
                INetworkClass networkClass = feature.Class as INetworkClass;

                IJunctionFlag[] array   = new JunctionFlag[2];
                INetFlag        netFlag = new JunctionFlag() as INetFlag;

                int userClassID;
                int userID;
                int userSubID;
                netElements.QueryIDs(_endEid, esriElementType.esriETJunction, out userClassID, out userID, out userSubID);
                netFlag.UserClassID = (userClassID);
                netFlag.UserID      = (userID);
                netFlag.UserSubID   = (userSubID);
                IJunctionFlag value = netFlag as IJunctionFlag;
                array.SetValue(value, 0);
                INetFlag netFlag2 = new JunctionFlag() as INetFlag;
                netElements.QueryIDs(_startEid, esriElementType.esriETJunction, out userClassID,
                                     out userID, out userSubID);
                netFlag2.UserClassID = (userClassID);
                netFlag2.UserID      = (userID);
                netFlag2.UserSubID   = (userSubID);
                value = (netFlag2 as IJunctionFlag);
                array.SetValue(value, 1);
                ITraceFlowSolverGEN traceFlowSolverGEN = new TraceFlowSolver() as ITraceFlowSolverGEN;
                INetSolver          netSolver          = traceFlowSolverGEN as INetSolver;
                netSolver.SourceNetwork = _geometricNetwork.Network;
                traceFlowSolverGEN.PutJunctionOrigins(ref array);
                object[]    array2 = new object[1];
                IEnumNetEID enumNetEID;
                IEnumNetEID enumNetEID2;
                traceFlowSolverGEN.FindPath((esriFlowMethod)2, (esriShortestPathObjFn)1, out enumNetEID,
                                            out enumNetEID2, 1, ref array2);
                if (this.ipolyline_0 == null)
                {
                    this.ipolyline_0 = new Polyline() as IPolyline;
                }
                IGeometryCollection geometryCollection = this.ipolyline_0 as IGeometryCollection;
                geometryCollection.RemoveGeometries(0, geometryCollection.GeometryCount);
                if (enumNetEID2.Count <= 0)
                {
                    this.ifeature_0 = null;
                    MessageBox.Show("两点之间不存在路径可以连通!");
                }
                else
                {
                    ShowShortObjectForm showShortObjectForm = new ShowShortObjectForm(_context);
                    showShortObjectForm.pApp = _context;
                    ISpatialReference spatialReference = _context.FocusMap.SpatialReference;
                    IEIDHelper        eIDHelperClass   = new EIDHelper();
                    eIDHelperClass.GeometricNetwork       = (networkClass.GeometricNetwork);
                    eIDHelperClass.OutputSpatialReference = (spatialReference);
                    eIDHelperClass.ReturnGeometries       = (true);
                    eIDHelperClass.ReturnFeatures         = (true);
                    IEnumEIDInfo enumEIDInfo = eIDHelperClass.CreateEnumEIDInfo(enumNetEID2);
                    int          count       = enumEIDInfo.Count;
                    enumEIDInfo.Reset();
                    for (int i = 0; i < count; i++)
                    {
                        IEIDInfo  iEIDInfo = enumEIDInfo.Next();
                        IGeometry geometry = iEIDInfo.Geometry;
                        if (i == 0)
                        {
                            showShortObjectForm.AddPipeName(this.string_0);
                        }
                        showShortObjectForm.AddFeature(iEIDInfo.Feature);
                        geometryCollection.AddGeometryCollection(geometry as IGeometryCollection);
                    }
                    showShortObjectForm.AddShortPath(this.ipolyline_0);
                    showShortObjectForm.AddLenght(this.ipolyline_0.Length);
                    this.ifeature_2 = feature;
                    EsriUtils.ZoomToGeometry(this.ipolyline_0, _context.MapControl.Map, 1.3);
                    FlashUtility.FlashGeometry(this.ipolyline_0, _context.MapControl);
                    this.ifeature_0   = null;
                    _startEid         = 0;
                    _startPoint       = null;
                    _geometricNetwork = null;
                    showShortObjectForm.Show();
                }
            }
            catch (Exception ex)
            {
                this.ifeature_0 = null;
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #11
0
        //Ϊ�����������ñߵ�Flag
        private void BurstSetEdgeFlag(IPoint pPoint)
        {
            //
            try
            {
                INetElements pNetElements = pGeoNetwork.Network as INetElements;
                IPointToEID pPtToEID = new PointToEIDClass();
                IPoint pNewPt;
                int iUserClassID;
                int iUserID;
                int iUserSubID;
                double dPercent;
                int eid;
                pPtToEID.SourceMap = axMapControl1.ActiveView.FocusMap;
                pPtToEID.GeometricNetwork = pGeoNetwork;
                pPtToEID.SnapTolerance = axMapControl1.ActiveView.Extent.Envelope.Width / 100;
                pPtToEID.GetNearestEdge(pPoint, out eid, out pNewPt, out dPercent);
                if (pNewPt == null)
                {
                    MessageBox.Show("û�в������ٽ��ı�");
                }
                else
                {
                    pNetElements.QueryIDs(eid, esriElementType.esriETEdge, out iUserClassID, out iUserID, out iUserSubID);
                    IMarkerSymbol pMarkerSym = new SimpleMarkerSymbolClass();
                    IRgbColor pRGBColor = new RgbColorClass();
                    pRGBColor.Red = 255;
                    pRGBColor.Green = 0;
                    pRGBColor.Blue = 0;
                    pMarkerSym.Color = pRGBColor;
                    pMarkerSym.Size = 20;
                    //�����µ�Flag

                    IEdgeFlagDisplay pEdgeFlagDisplay = new EdgeFlagDisplayClass();
                    IFlagDisplay pFlagDisplay = pEdgeFlagDisplay as IFlagDisplay;
                    pFlagDisplay.Symbol = pMarkerSym as ISymbol;
                    pFlagDisplay.Geometry = pNewPt;
                    pFlagDisplay.FeatureClassID = iUserClassID;
                    pFlagDisplay.FID = iUserID;
                    pFlagDisplay.SubID = iUserSubID;

                    //���Ƹõ�
                    IScreenDisplay pScreenDisplay = axMapControl1.ActiveView.ScreenDisplay;
                    pScreenDisplay.StartDrawing(pScreenDisplay.hDC, 0);
                    pScreenDisplay.SetSymbol(pMarkerSym as ISymbol);
                    pScreenDisplay.DrawPoint(pNewPt as IGeometry);
                    pScreenDisplay.FinishDrawing();
                    BurstFindValves(pFlagDisplay);
                }
            }
            catch (Exception eX)
            {
                MessageBox.Show(eX.Message);

            }
        }
        public override void OnMouseDown(int button, int Shift, int x, int y)
        {
            if (button != 1)
            {
                return;
            }

            this.SelectByClick(x, y);
            IMap         map         = _context.FocusMap;
            IEnumFeature enumFeature = (IEnumFeature)map.FeatureSelection;
            IFeature     feature     = enumFeature.Next();

            if (feature == null)
            {
                if (Shift == 1)
                {
                    this.m_SectionControl.RebuildSelection();
                }
                else
                {
                    this.m_SectionControl.LayerName = "";
                    this.m_SectionControl.Clear();
                    this._context.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, _context.ActiveView.Extent);
                }
            }
            else
            {
                string aliasName = feature.Class.AliasName;
                int    oID;
                if (feature.HasOID)
                {
                    oID = feature.OID;
                }
                else
                {
                    if (feature.FeatureType == esriFeatureType.esriFTSimpleEdge ||
                        feature.FeatureType == esriFeatureType.esriFTComplexEdge)
                    {
                        IPolyline egLine    = feature.Shape as IPolyline;
                        IPoint    newCenter = new PointClass();
                        egLine.QueryPoint(esriSegmentExtension.esriNoExtension, 0.01, true, newCenter);
                        IEdgeFeature  pEgFeature    = feature as IEdgeFeature;
                        IFeatureClass pClass        = feature.Class as IFeatureClass;
                        INetworkClass pNetworkClass = pClass as INetworkClass;
                        INetElements  network       = pNetworkClass.GeometricNetwork.Network as INetElements;
                        IPointToEID   pntEID        = new PointToEIDClass();
                        pntEID.GeometricNetwork = pNetworkClass.GeometricNetwork;
                        pntEID.SourceMap        = _context.FocusMap;
                        pntEID.SnapTolerance    = CommonHelper.ConvertPixelsToMapUnits(_context.ActiveView, 5.0);
                        double percent;
                        int    edgeID;
                        IPoint location;
                        pntEID.GetNearestEdge(newCenter, out edgeID, out location, out percent);
                        if (percent == 0)
                        {
                            return;
                        }

                        int userClassID, userID, userSubID;

                        network.QueryIDs(edgeID, esriElementType.esriETEdge, out userClassID, out userID, out userSubID);
                        if (pClass.FeatureClassID == userClassID)
                        {
                            feature = pClass.GetFeature(userID);
                        }
                        else
                        {
                            IEnumDataset dses = pNetworkClass.FeatureDataset.Subsets;
                            dses.Reset();
                            IDataset ds = dses.Next();
                            while (ds != null)
                            {
                                if (ds is IFeatureClass)
                                {
                                    IFeatureClass pClass2 = ds as IFeatureClass;
                                    if (pClass2.FeatureClassID == userClassID)
                                    {
                                        feature = pClass2.GetFeature(userID);
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    oID = feature.OID;
                }
                if (Shift != 1)
                {
                    this.m_SectionControl.Clear();
                    this.m_SectionControl.LayerName = aliasName;
                    this.m_SectionControl.Add(oID);
                }
                else if (this.m_SectionControl.Count == 0)
                {
                    this.m_SectionControl.LayerName = aliasName;
                    this.m_SectionControl.Add(oID);
                }
                else if (this.m_SectionControl.IsInSameLayer(aliasName))
                {
                    this.m_SectionControl.LayerName = aliasName;
                    this.m_SectionControl.Add(oID);
                }
            }
        }
Beispiel #13
0
        public override void GetSelectedData()
        {
            this.method_3();
            IMap map = this.m_context.FocusMap;
            ITopologicalOperator topologicalOperator = (ITopologicalOperator)this.m_pBaseLine;
            IGeometry            geometry            = topologicalOperator.Buffer(0.0);

            map.ClearSelection();
            ISelectionEnvironment selectionEnvironment = new SelectionEnvironment();

            map.SelectByShape(geometry, selectionEnvironment, false);
            IEnumFeature enumFeature = (IEnumFeature)map.FeatureSelection;
            IFeature     feature     = enumFeature.Next();

            while (feature != null)
            {
                if (feature.FeatureType == esriFeatureType.esriFTSimpleEdge)
                {
                    IPolyline egLine    = feature.Shape as IPolyline;
                    IPoint    newCenter = new PointClass();
                    egLine.QueryPoint(esriSegmentExtension.esriNoExtension, 0.01, true, newCenter);

                    IEdgeFeature pEgFeature = feature as IEdgeFeature;


                    IFeatureClass pClass        = feature.Class as IFeatureClass;
                    INetworkClass pNetworkClass = pClass as INetworkClass;
                    INetElements  network       = pNetworkClass.GeometricNetwork.Network as INetElements;
                    IPointToEID   pntEID        = new PointToEIDClass();
                    pntEID.GeometricNetwork = pNetworkClass.GeometricNetwork;
                    pntEID.SourceMap        = m_context.FocusMap;
                    pntEID.SnapTolerance    = CommonHelper.ConvertPixelsToMapUnits(m_context.ActiveView, 5.0);
                    double percent;
                    int    edgeID;
                    IPoint location;
                    pntEID.GetNearestEdge(newCenter, out edgeID, out location, out percent);
                    if (percent == 0)
                    {
                        feature = enumFeature.Next();
                        continue;
                    }

                    int userClassID, userID, userSubID;

                    network.QueryIDs(edgeID, esriElementType.esriETEdge, out userClassID, out userID, out userSubID);
                    if (pClass.FeatureClassID == userClassID)
                    {
                        feature = pClass.GetFeature(userID);
                    }
                    else
                    {
                        IEnumDataset dses = pNetworkClass.FeatureDataset.Subsets;
                        dses.Reset();
                        IDataset ds = dses.Next();
                        while (ds != null)
                        {
                            if (ds is IFeatureClass)
                            {
                                IFeatureClass pClass2 = ds as IFeatureClass;
                                if (pClass2.FeatureClassID == userClassID)
                                {
                                    feature = pClass2.GetFeature(userID);
                                    break;
                                }
                            }
                        }
                    }
                }
                string  smpClassName = CommonUtils.GetSmpClassName(feature.Class.AliasName);
                IMAware mWAware      = feature.Shape as IMAware;
                bool    isMUsing     = mWAware.MAware;

                IBasicLayerInfo lineConfig = PipeConfig.GetBasicLayerInfo(feature.Class.AliasName) as IBasicLayerInfo;
                if (lineConfig == null && !smpClassName.ToUpper().Contains("JT_JT_L") &&
                    !smpClassName.ToUpper().Contains("SY_ZX_L") && !smpClassName.ToUpper().Contains("ZB_LD_R"))
                {
                    feature = enumFeature.Next();
                }
                else
                {
                    IGeometry shape = feature.Shape;
                    if (shape.GeometryType != esriGeometryType.esriGeometryPolyline &&
                        shape.GeometryType != esriGeometryType.esriGeometryPolygon)
                    {
                        feature = enumFeature.Next();
                    }
                    else
                    {
                        IPolyline polyline;
                        if (shape.GeometryType == esriGeometryType.esriGeometryPolygon)
                        {
                            polyline = this.PolygonToPolyline((IPolygon)shape);
                        }
                        else
                        {
                            polyline = (IPolyline)shape;
                        }
                        GPoints gPoints = null;
                        if (isMUsing)
                        {
                            gPoints = this.CalculateIntersections(this.m_pBaseLine, polyline);
                        }
                        else
                        {
                            gPoints = this.CalculateIntersections(this.m_pBaseLine, feature, lineConfig);
                        }

                        //string text = "管线性质";
                        string text            = lineConfig.GetFieldName(PipeConfigWordHelper.LineWords.GDXZ);
                        string bstrDatasetName = "";
                        int    num             = feature.Fields.FindField(text);
                        if (num != -1)
                        {
                            object obj = feature.get_Value(num);
                            if (obj == null || Convert.IsDBNull(obj))
                            {
                                bstrDatasetName = "";
                            }
                            else
                            {
                                bstrDatasetName = obj.ToString();
                            }
                        }
                        if (gPoints == null)
                        {
                            feature = enumFeature.Next();
                        }
                        else
                        {
                            int num2 = gPoints.Size();
                            for (int i = 0; i < num2; i++)
                            {
                                GPoint gPoint = gPoints[i];

                                PipePoint pipePoint = new PipePoint();
                                if (smpClassName.ToUpper().Contains("JT_JT_L"))
                                {
                                    pipePoint.PointType = PipePoint.SectionPointType.sptRoadBorder;
                                }
                                else if (smpClassName.ToUpper().Contains("SY_ZX_L"))
                                {
                                    pipePoint.PointType = PipePoint.SectionPointType.sptMidRoadLine;
                                }
                                else if (smpClassName.ToUpper().Contains("ZB_LD_R"))
                                {
                                    pipePoint.PointType = PipePoint.SectionPointType.sptMidGreen;
                                }
                                else
                                {
                                    pipePoint.PointType = PipePoint.SectionPointType.sptPipe;
                                }
                                pipePoint.x = gPoint.X;
                                pipePoint.y = gPoint.Y;
                                pipePoint.z = gPoint.Z;
                                pipePoint.m = gPoint.M;
                                pipePoint.bstrDatasetName = bstrDatasetName;
                                //  int num3 = feature.Fields.FindField(base.PipeConfig.get_Material());
                                int num3 =
                                    feature.Fields.FindField(lineConfig.GetFieldName(PipeConfigWordHelper.LineWords.GXCZ));
                                if (num3 == -1)
                                {
                                    pipePoint.strMaterial = "";
                                }
                                else
                                {
                                    object obj2 = feature.get_Value(num3);
                                    if (obj2 != null)
                                    {
                                        pipePoint.strMaterial = feature.get_Value(num3).ToString();
                                    }
                                    else
                                    {
                                        pipePoint.strMaterial = "";
                                    }
                                }
                                // num3 = feature.Fields.FindField(base.PipeConfig.get_Diameter());
                                num3 =
                                    feature.Fields.FindField(lineConfig.GetFieldName(PipeConfigWordHelper.LineWords.GJ));
                                string text2;
                                if (num3 != -1 && feature.get_Value(num3) != null)
                                {
                                    text2 = feature.get_Value(num3).ToString();
                                }
                                else
                                {
                                    text2 = "";
                                }
                                num3 =
                                    feature.Fields.FindField(lineConfig.GetFieldName(PipeConfigWordHelper.LineWords.DMCC));
                                string text3;
                                if (num3 != -1 && feature.get_Value(num3) != null)
                                {
                                    text3 = feature.get_Value(num3).ToString();
                                }
                                else
                                {
                                    text3 = "";
                                }
                                if (text2 != "")
                                {
                                    pipePoint.strPipeWidthHeight = text2;
                                }
                                if (text3 != "")
                                {
                                    pipePoint.strPipeWidthHeight = text3;
                                }
                                Color featureColor = CommonUtils.GetFeatureColor(map, feature.Class.AliasName, feature);
                                pipePoint.Red   = (int)featureColor.R;
                                pipePoint.Green = (int)featureColor.G;
                                pipePoint.Blue  = (int)featureColor.B;
                                this.m_arrPipePoints.Add(pipePoint);
                            }
                            feature = enumFeature.Next();
                        }
                    }
                }
            }
            map.ClearSelection();
            IPointCollection pointCollection = (IPointCollection)this.m_pBaseLine;
            int pointCount = pointCollection.PointCount;

            if (pointCount != 0)
            {
                for (int j = 0; j < pointCount; j++)
                {
                    IPoint    point      = pointCollection.get_Point(j);
                    double    x          = point.X;
                    double    y          = point.Y;
                    PipePoint pipePoint2 = new PipePoint();
                    pipePoint2.x         = x;
                    pipePoint2.y         = y;
                    pipePoint2.PointType = PipePoint.SectionPointType.sptDrawPoint;
                    this.m_arrPipePoints.Add(pipePoint2);
                }
                this.fEswZsmwIx((PipePoint)this.m_arrPipePoints[this.m_arrPipePoints.Count - 2]);
                this.method_1();
                if (this.method_2())
                {
                    this.method_5(this.m_arrPipePointsDraw, this.m_arrPipePoints);
                    this.method_4();
                    this.method_7(this.m_arrPipePointsDraw);
                }
            }
        }
Beispiel #14
0
        /// <summary>
        /// Adds  edge flags for a feature layer
        /// </summary>
        /// <param name="layer">The feature layer</param>
        private void AddEdgeFlags(IFeatureLayer layer)
        {
            try
            {
                // QI all the network analysis interfaces
                INetworkAnalysisExt         netAnalyst = (INetworkAnalysisExt)this.UtilityNetAnalysisExt;
                INetworkAnalysisExtFlags    flags      = (INetworkAnalysisExtFlags)this.UtilityNetAnalysisExt;
                INetworkAnalysisExtBarriers barriers   = (INetworkAnalysisExtBarriers)this.UtilityNetAnalysisExt;

                IPointToEID point2EID = new PointToEIDClass();
                point2EID.GeometricNetwork = this.NetworkAnalysisExt.CurrentNetwork;
                point2EID.SourceMap        = ((IMxDocument)this.Application.Document).FocusMap;
                point2EID.SnapTolerance    = this.SnapTolerance;

                INetElements networkElements = (INetElements)this.NetworkAnalysisExt.CurrentNetwork.Network;

                IFeatureSelection featureSelection = (IFeatureSelection)layer;
                ISelectionSet     selectionSet     = (ISelectionSet)featureSelection.SelectionSet;

                IEnumIDs ids = selectionSet.IDs;

                int i;

                while ((i = ids.Next()) > 0)
                {
                    IFeature feature = layer.FeatureClass.GetFeature(i);

                    IPoint locationPoint;
                    int    nearestEdgeID;
                    double perCent;

                    point2EID.GetNearestEdge((IPoint)feature.ShapeCopy, out nearestEdgeID, out locationPoint, out perCent);

                    if (networkElements.IsValidElement(nearestEdgeID, esriElementType.esriETEdge))
                    {
                        int userclassID;
                        int userID;
                        int usersubID;

                        networkElements.QueryIDs(nearestEdgeID, esriElementType.esriETEdge, out userclassID, out userID, out usersubID);

                        IFlagDisplay flagDisplay = new EdgeFlagDisplayClass();
                        flagDisplay.FeatureClassID = userclassID;
                        flagDisplay.FID            = userID;
                        flagDisplay.SubID          = usersubID;

                        flagDisplay.Geometry = locationPoint;

                        flagDisplay.Symbol = this.EdgeFlagSymbol;

                        flags.AddEdgeFlag((IEdgeFlagDisplay)flagDisplay);
                        this.AddFlagCount++;
                        this.OnAddFlag(locationPoint);
                    }
                    else
                    {
                        this.OnAddFlagError(layer.Name, "No nearby edge feature.", feature.OID);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex.StackTrace);
                throw;
            }
        }
        /// <summary>
        /// 求解最短路径
        /// </summary>
        /// <param name="_pMap"></param>
        /// <param name="_pGeometricNetwork"></param>
        /// <param name="_pWeightName"></param>
        /// <param name="_pPoints"></param>
        /// <param name="_pDist"></param>
        /// <param name="_pPolyline"></param>
        /// <param name="_pPathCost"></param>
        public void SolvePath(IMap _pMap, IGeometricNetwork _pGeometricNetwork, string _pWeightName, IPointCollection _pPoints, double _pDist, ref IPolyline _pPolyline, ref double _pPathCost)
        {
            try
            { // 这4个参数其实就是一个定位Element的指标
                int intEdgeUserClassID;

                int intEdgeUserID;

                int intEdgeUserSubID;

                int intEdgeID;

                IPoint pFoundEdgePoint;

                double dblEdgePercent;

                ITraceFlowSolverGEN pTraceFlowSolver = new TraceFlowSolverClass() as ITraceFlowSolverGEN;

                INetSolver pNetSolver = pTraceFlowSolver as INetSolver;

                //操作是针对逻辑网络的,INetwork是逻辑网络

                INetwork pNetwork = _pGeometricNetwork.Network;

                pNetSolver.SourceNetwork = pNetwork;

                INetElements pNetElements = pNetwork as INetElements;

                int pCount = _pPoints.PointCount;
                //定义一个边线旗数组
                IEdgeFlag[] pEdgeFlagList = new EdgeFlagClass[pCount];

                IPointToEID pPointToEID = new PointToEIDClass();

                pPointToEID.SourceMap = _pMap;

                pPointToEID.GeometricNetwork = _pGeometricNetwork;

                pPointToEID.SnapTolerance = _pDist;

                for (int i = 0; i < pCount; i++)
                {
                    INetFlag pNetFlag = new EdgeFlagClass() as INetFlag;

                    IPoint pEdgePoint = _pPoints.get_Point(i);
                    //查找输入点的最近的边线
                    pPointToEID.GetNearestEdge(pEdgePoint, out intEdgeID, out pFoundEdgePoint, out dblEdgePercent);

                    pNetElements.QueryIDs(intEdgeID, esriElementType.esriETEdge, out intEdgeUserClassID, out intEdgeUserID, out intEdgeUserSubID);

                    pNetFlag.UserClassID = intEdgeUserClassID;

                    pNetFlag.UserID = intEdgeUserID;

                    pNetFlag.UserSubID = intEdgeUserSubID;

                    IEdgeFlag pTemp = (IEdgeFlag)(pNetFlag as IEdgeFlag);
                    pEdgeFlagList[i] = pTemp;
                }
                pTraceFlowSolver.PutEdgeOrigins(ref pEdgeFlagList);

                INetSchema pNetSchema = pNetwork as INetSchema;

                INetWeight pNetWeight = pNetSchema.get_WeightByName(_pWeightName);

                INetSolverWeightsGEN pNetSolverWeights = pTraceFlowSolver as INetSolverWeightsGEN;

                pNetSolverWeights.FromToEdgeWeight = pNetWeight;//开始边线的权重

                pNetSolverWeights.ToFromEdgeWeight = pNetWeight;//终止边线的权重

                object[] pRes = new object[pCount - 1];

                //通过FindPath得到边线和交汇点的集合
                IEnumNetEID  pEnumNetEID_Junctions;

                IEnumNetEID pEnumNetEID_Edges;

                pTraceFlowSolver.FindPath(esriFlowMethod.esriFMConnected,
                 esriShortestPathObjFn.esriSPObjFnMinSum,
                 out pEnumNetEID_Junctions, out pEnumNetEID_Edges, pCount - 1, ref pRes);
                //计算元素成本
                _pPathCost = 0;
                for (int i = 0; i < pRes.Length; i++)
                {
                    double m_Va = (double)pRes[i];

                    _pPathCost = _pPathCost + m_Va;
                }

                IGeometryCollection pNewGeometryColl = _pPolyline as IGeometryCollection;//QI

                ISpatialReference pSpatialReference = _pMap.SpatialReference;

                IEIDHelper pEIDHelper = new EIDHelperClass();

                pEIDHelper.GeometricNetwork = _pGeometricNetwork;

                pEIDHelper.OutputSpatialReference = pSpatialReference;

                pEIDHelper.ReturnGeometries = true;

                IEnumEIDInfo pEnumEIDInfo = pEIDHelper.CreateEnumEIDInfo(pEnumNetEID_Edges);

                int Count = pEnumEIDInfo.Count;

                pEnumEIDInfo.Reset();

                for (int i = 0; i < Count; i++)
                {
                    IEIDInfo pEIDInfo = pEnumEIDInfo.Next();

                    IGeometry pGeometry = pEIDInfo.Geometry;

                    pNewGeometryColl.AddGeometryCollection(pGeometry as IGeometryCollection);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }