ArcEngine 最短路徑分析(原始碼)
ArcEngine 最短路徑分析(原始碼) |
using System; namespace GisEditor #region Public Function IEnumEIDInfo ipEnumEIDInfo = ipEIDHelper.CreateEnumEIDInfo(m_ipEnumNetEID_Edges); INetSolverWeights ipNetSolverWeights = ipTraceFlowSolver as INetSolverWeights; #region Private Function INetworkCollection ipNetworkCollection = FeatureDataset as INetworkCollection; if(m_ipMap!=null) m_ipPointToEID = new PointToEIDClass(); double dblWidth = ipMaxEnvelope.Width; if( dblWidth > dblHeight) return true ; } 備註: 在呼叫該類時的次序: ClsPathFinder m_ipPathFinder; if(m_ipPathFinder==null)//開啟幾何網路工作空間 private void ViewMap_OnMouseDown(object sender, ESRI.ArcGIS.MapControl.IMapControlEvents2_OnMouseDownEvent e)//獲取地圖上滑鼠輸入的點 m_ipPathFinder.SolvePath("Weight");//先解析路徑 IPolyline ipPolyResult = m_ipPathFinder.PathPolyLine();//最後返回最短路徑 |