欢迎来到天天文库
浏览记录
ID:34353124
大小:46.50 KB
页数:7页
时间:2019-03-05
《arcgis_engine+最短路径分析(c#源码)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、.建立network,是把有关联的数据表之间的空间关系建立起来你可以用arccatalog或者arctoolbox中的工具来创建其实你这个问题,直接搜索一下arcgis,创建network,就能得到答案了呀desktop中有向导式的工具,具体叫什么名字我忘记了,好像是在topologic还是哪个组下面,你找一下肯定找的到的。单单用engine是不成的usingESRI.ArcGIS.NetworkAnalysis;publicclassClsPathFinder{privateIGeometricNetworkm_ipGeometricNetwork;privateIMapm_ipMap;p
2、rivateIPointCollectionm_ipPoints;privateIPointToEIDm_ipPointToEID;privatedoublem_dblPathCost=0;privateIEnumNetEIDm_ipEnumNetEID_Junctions;privateIEnumNetEIDm_ipEnumNetEID_Edges;privateIPolylinem_ipPolyline;#regionPublicFunction//返回和设置当前地图publicIMapSetOrGetMap{set{m_ipMap=value;}get{returnm_ipMap;}}
3、//打开网络publicvoidOpenFeatureDatasetNetwork(IFeatureDatasetFeatureDataset){CloseWorkspace();if(!InitializeNetworkAndMap(FeatureDataset))Console.WriteLine("打开出错");}//输入点的集合publicIPointCollectionStopPoints{set{m_ipPoints=value;}get{returnm_ipPoints;}}...//路径成本publicdoublePathCost{get{returnm_dblPathCos
4、t;}}//返回路径publicIPolylinePathPolyLine(){IEIDInfoipEIDInfo;IGeometryipGeometry;if(m_ipPolyline!=null)returnm_ipPolyline;m_ipPolyline=newPolylineClass();IGeometryCollectionipNewGeometryColl=m_ipPolylineasIGeometryCollection;ISpatialReferenceipSpatialReference=m_ipMap.SpatialReference;IEIDHelperipEIDH
5、elper=newEIDHelperClass();ipEIDHelper.GeometricNetwork=m_ipGeometricNetwork;ipEIDHelper.OutputSpatialReference=ipSpatialReference;ipEIDHelper.ReturnGeometries=true;IEnumEIDInfoipEnumEIDInfo=ipEIDHelper.CreateEnumEIDInfo(m_ipEnumNetEID_Edges);intcount=ipEnumEIDInfo.Count;ipEnumEIDInfo.Reset();for(in
6、ti=0;i7、intipFoundEdgePoint;doubledblEdgePercent;/*C#中使用*ITraceFlowSolverGEN替代ITraceFlowSolver*/ITraceFlowSolverGENipTraceFlowSolver=newTraceFlowSolverClass()asITraceFlowSolverGEN;INetSolveripNetSolver=ipTraceFlowS
7、intipFoundEdgePoint;doubledblEdgePercent;/*C#中使用*ITraceFlowSolverGEN替代ITraceFlowSolver*/ITraceFlowSolverGENipTraceFlowSolver=newTraceFlowSolverClass()asITraceFlowSolverGEN;INetSolveripNetSolver=ipTraceFlowS
此文档下载收益归作者所有