资源简介
AE开发创建的Windows设计出的窗体,对最短路径分析进行开发代码
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.NetworkAnalysis;
using ESRI.ArcGIS.DataSourcesGDB;
using System.Windows.Forms;
namespace 最短路径
{
class ClsPathFinder
{
private IGeometricNetwork m_ipGeometricNetwork;
private IMap m_ipMap;
private IPointCollection m_ipPoints;
private IPointToEID m_ipPointToEID;
private double m_dblPathCost = 0;
private IEnumNetEID m_ipEnumNetEID_Junctions;
private IEnumNetEID m_ipEnumNetEID_Edges;
private IPolyline m_ipPolyline;
private IActiveView m_ipActiveView;
//返回和设置当前地图
public IMap SetOrGetMap
{
set { m_ipMap = value; }
get { return m_ipMap; }
}
public IActiveView SetOrGetActiveView
{
set { m_ipActiveView = value; }
get { return m_ipActiveView; }
}
//打开几何数据集的网络工作空间
public void OpenFeatureDatasetNetwork(IFeatureDataset FeatureDataset)
{
CloseWorkspace();
if (!InitializeNetworkAndMap(FeatureDataset))
Console.WriteLine(“打开network出错“);
}
//输入点的集合
public IPointCollection StopPoints
{
set { m_ipPoints = value; }
get { return m_ipPoints; }
}
//路径成本
public double PathCost
{
get { return m_dblPathCost; }
}
//返回路径的几何体
public IPolyline PathPolyLine()
{
IEIDInfo ipEIDInfo;
IGeometry ipGeometry;
if (m_ipPolyline != null) return m_ipPolyline;
m_ipPolyline = new PolylineClass();
IGeometryCollection ipNewGeometryColl = m_ipPolyline as IGeometryCollection;//引用传递
ISpatialReference ipSpatialReference = m_ipMap.SpatialReference;
IEIDHelper ipEIDHelper = new EIDHelperClass();
ipEIDHelper.GeometricNetwork = m_ipGeometricNetwork;
ipEIDHelper.OutputSpatialReference = ipSpatialReference;
ipEIDHelper.ReturnGeometries = true;
IEnumEIDInfo ipEnumEIDInfo = ipEIDHelper.CreateEnumEIDInfo(m_ipEnumNetEID_Edges);
int count = ipEnumEIDInfo.Count;
ipEnumEIDInfo.Reset();
for (int i = 0; i < count; i++)
{
ipEIDInfo = ipEnumEIDInfo.Next();
ipGeometry = ipEIDInfo.Geometry;
ipNewGeometryColl.AddGeometryCollection(ipGeometry as IGeometryCollection);
}
return m_ipPolyline;
}
//解决路径
public void SolvePath(string WeightName)
{
try
{
int intEdgeUserClassID;
int intEdgeUserID;
int intEdgeUserSubID;
int intEdgeID;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 36864 2006-05-09 16:27 FindShortPath\FindShortPath\bin\Debug\FindShortPath.exe
文件 38400 2006-05-09 16:27 FindShortPath\FindShortPath\bin\Debug\FindShortPath.pdb
文件 5632 2005-09-23 06:56 FindShortPath\FindShortPath\bin\Debug\FindShortPath.vshost.exe
文件 10344 2006-04-21 13:21 FindShortPath\FindShortPath\ClsPathFinder.cs
文件 5342 2006-04-26 17:35 FindShortPath\FindShortPath\FindShortPath.csproj
文件 14094 2006-04-26 17:35 FindShortPath\FindShortPath\Form1.cs
文件 12821 2006-04-26 17:33 FindShortPath\FindShortPath\Form1.Designer.cs
文件 15721 2006-04-26 17:33 FindShortPath\FindShortPath\Form1.resx
文件 842 2006-04-26 17:33 FindShortPath\FindShortPath\obj\Debug\FindShortPath.csproj.GenerateResource.Cache
文件 36864 2006-05-09 16:27 FindShortPath\FindShortPath\obj\Debug\FindShortPath.exe
文件 6450 2006-05-09 16:27 FindShortPath\FindShortPath\obj\Debug\FindShortPath.Form1.resources
文件 38400 2006-05-09 16:27 FindShortPath\FindShortPath\obj\Debug\FindShortPath.pdb
文件 180 2006-05-09 16:27 FindShortPath\FindShortPath\obj\Debug\FindShortPath.Properties.Resources.resources
文件 134841 2006-04-26 17:35 FindShortPath\FindShortPath\obj\Debug\ResolveAssemblyReference.cache
文件 310 2006-05-09 16:27 FindShortPath\FindShortPath\obj\FindShortPath.csproj.FileList.txt
文件 483 2006-04-26 11:34 FindShortPath\FindShortPath\Program.cs
文件 1298 2006-04-26 11:34 FindShortPath\FindShortPath\Properties\AssemblyInfo.cs
文件 2853 2006-04-26 11:34 FindShortPath\FindShortPath\Properties\Resources.Designer.cs
文件 5612 2006-04-26 11:34 FindShortPath\FindShortPath\Properties\Resources.resx
文件 1096 2006-04-26 11:34 FindShortPath\FindShortPath\Properties\Settings.Designer.cs
文件 249 2006-04-26 11:34 FindShortPath\FindShortPath\Properties\Settings.settings
文件 928 2006-04-26 11:34 FindShortPath\FindShortPath.sln
..A..H. 18944 2006-05-09 16:28 FindShortPath\FindShortPath.suo
目录 0 2006-05-05 14:47 FindShortPath\FindShortPath\obj\Debug\Refactor
目录 0 2006-05-05 14:47 FindShortPath\FindShortPath\obj\Debug\TempPE
目录 0 2006-05-05 14:47 FindShortPath\FindShortPath\bin\Debug
目录 0 2006-05-09 16:27 FindShortPath\FindShortPath\obj\Debug
目录 0 2006-05-05 14:47 FindShortPath\FindShortPath\bin
目录 0 2006-05-05 14:47 FindShortPath\FindShortPath\obj
目录 0 2006-05-05 14:47 FindShortPath\FindShortPath\Properties
............此处省略5个文件信息
评论
共有 条评论