Arcengine最短路径分析实现的源程序

辛子俊 2019-12-22 00:00:00

推荐回答

用的Arcengine10~你看看namespaceGisEditor{//////最短路径分析///publicclassClsPathFinder{privateIGeometricNetworkm_ipGeometricNetwork;privateIMapm_ipMap;privateIPointCollectionm_ipPoints;privateIPointToEIDm_ipPointToEID;privatedoublem_dblPathCost=0;privateIEnumNetEIDm_ipEnumNetEID_Junctions;privateIEnumNetEIDm_ipEnumNetEID_Edges;privateIPolylinem_ipPolyline;#regionPublicFunction//返回和设置当前地图publicIMapSetOrGetMap{set{m_ipMap=value;}get{returnm_ipMap;}}//打开几何数据集的网络工作空间publicvoidOpenFeatureDatasetNetworkIFeatureDatasetFeatureDataset{CloseWorkspace;if!InitializeNetworkAndMapFeatureDatasetConsole.WriteLine"打开network出错";}//输入点的集合publicIPointCollectionStopPoints{set{m_ipPoints=value;}get{returnm_ipPoints;}}//路径成本publicdoublePathCost{get{returnm_dblPathCost;}}//返回路径的几何体publicIPolylinePathPolyLine{IEIDInfoipEIDInfo;IGeometryipGeometry;ifm_ipPolyline!=nullreturnm_ipPolyline;Polylinem_ipPolyline2=newPolyline;m_ipPolyline=IPolylinem_ipPolyline2;IGeometryCollectionipNewGeometryColl=m_ipPolylineasIGeometryCollection;ISpatialReferenceipSpatialReference=m_ipMap.SpatialReference;IEIDHelperipEIDHelper=newEIDHelper;ipEIDHelper.GeometricNetwork=m_ipGeometricNetwork;ipEIDHelper.OutputSpatialReference=ipSpatialReference;ipEIDHelper.ReturnGeometries=true;IEnumEIDInfoipEnumEIDInfo=ipEIDHelper.CreateEnumEIDInfom_ipEnumNetEID_Edges;intcount=ipEnumEIDInfo.Count;ipEnumEIDInfo.Reset;forinti=0;idblHeightdblSearchTol=dblWidth/100;elsedblSearchTol=dblHeight/100;m_ipPointToEID.SnapTolerance=dblSearchTol;returntrue;}//关闭工作空间privatevoidCloseWorkspace{m_ipGeometricNetwork=null;m_ipPoints=null;m_ipPointToEID=null;m_ipEnumNetEID_Junctions=null;m_ipEnumNetEID_Edges=null;m_ipPolyline=null;}#endregion}。
齐文艺2019-12-22 00:07:06

提示您:回答为网友贡献,仅供参考。

相关问答