资源简介
从零开始:AE二次开发中获取A点到B点的最佳路径(5) 文章中的源代码。其实跟文章中的一模一样。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ESRI.ArcGIS.NetworkAnalysis;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Controls;
namespace WindowsFormsApplication3
{
class ClassPathFinder
{
AxMapControl mymap;
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;
private bool clicked;
IGraphicsContainer pGC;
int clickedcount = 0;
public ClassPathFinder(object map)
{
this.mymap = map as AxMapControl;
m_ipActiveView = mymap.ActiveView;
m_ipMap = m_ipActiveView.FocusMap;
clicked = false;
pGC = m_ipMap as IGraphicsContainer;
}
#region Public Function
//返回和设置当前地图
public IMap SetOrGetMap
{
set { m_ipMap = value; }
get { return m_ipMap; }
}
//打开网络
public void OpenFeatureDatasetNetwork(IFeatureDataset FeatureDataset)
{
CloseWorkspace();
if (!InitializeNetworkAndMap(FeatureDataset))
Console.WriteLine(“打开出错“);
}
//输入点的集合
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);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 269312 2014-04-09 10:22 WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.exe
文件 126464 2014-04-09 10:22 WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.pdb
文件 11600 2014-04-09 15:45 WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe
文件 490 2010-03-17 22:39 WindowsFormsApplication3\WindowsFormsApplication3\bin\Debug\WindowsFormsApplication3.vshost.exe.manifest
文件 1503 2014-02-20 10:10 WindowsFormsApplication3\WindowsFormsApplication3\ClassDiagram1.cd
文件 9083 2014-04-09 09:23 WindowsFormsApplication3\WindowsFormsApplication3\ClassPathFinder.cs
文件 2335 2014-03-24 10:16 WindowsFormsApplication3\WindowsFormsApplication3\CloloTest.cs
文件 5691 2014-03-24 10:16 WindowsFormsApplication3\WindowsFormsApplication3\CloloTest.Designer.cs
文件 5817 2014-03-24 10:16 WindowsFormsApplication3\WindowsFormsApplication3\CloloTest.resx
文件 2494 2014-02-20 10:10 WindowsFormsApplication3\WindowsFormsApplication3\Form1.cs
文件 6609 2014-02-20 10:10 WindowsFormsApplication3\WindowsFormsApplication3\Form1.Designer.cs
文件 197013 2014-02-20 10:10 WindowsFormsApplication3\WindowsFormsApplication3\Form1.resx
文件 724 2014-03-24 16:12 WindowsFormsApplication3\WindowsFormsApplication3\Form2.cs
文件 3599 2014-03-24 16:12 WindowsFormsApplication3\WindowsFormsApplication3\Form2.Designer.cs
文件 5817 2014-03-24 16:12 WindowsFormsApplication3\WindowsFormsApplication3\Form2.resx
文件 49233 2014-03-27 18:33 WindowsFormsApplication3\WindowsFormsApplication3\MapsTest.cs
文件 10571 2014-03-27 18:33 WindowsFormsApplication3\WindowsFormsApplication3\MapsTest.Designer.cs
文件 127572 2014-03-27 18:33 WindowsFormsApplication3\WindowsFormsApplication3\MapsTest.resx
文件 31217 2014-04-09 09:51 WindowsFormsApplication3\WindowsFormsApplication3\NetworkAnalysis.cs
文件 13053 2014-04-09 09:02 WindowsFormsApplication3\WindowsFormsApplication3\NetworkAnalysis.Designer.cs
文件 9907 2014-04-09 09:02 WindowsFormsApplication3\WindowsFormsApplication3\NetworkAnalysis.resx
文件 129277 2014-02-19 11:38 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6782 2014-04-09 15:47 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 180 2014-04-09 10:08 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.CloloTest.resources
文件 1771 2014-04-09 15:45 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.csproj.FileListAbsolute.txt
文件 1281 2014-04-09 10:13 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.csproj.GenerateResource.Cache
文件 149168 2014-03-18 09:24 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.csprojResolveAssemblyReference.cache
文件 269312 2014-04-09 10:22 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.exe
文件 127598 2014-04-09 10:08 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.Form1.resources
文件 180 2014-04-09 10:08 WindowsFormsApplication3\WindowsFormsApplication3\obj\x86\Debug\WindowsFormsApplication3.Form2.resources
............此处省略29个文件信息
相关资源
- WPF USB 网络 串口 通信软件
- ManageEngine_OpManager_12.3安装手册+管理员
- B/S 网上订餐系统
- 教室管理系统.rar
- ArcGIS Engine最优路径分析
- 小鸡快跑游戏.
-
分别适用于.NET fr
amework 2.0和4.0的E - 汽车租赁系统............................
- arcgis engine实现叠加分析
- arcgis 10.1 中文环境安装包
- 德卡D8读写器关于读写感应卡的一些代
- 地图符号化(ArcEngine)
- 地图浏览(ArcEngine)
- halcon 测量助手
- 图片存储到数据库保存二进制文件并
- Arcgis 扩展模块
- 用Socket写的简易FTP服务器和客户端
- 企业销售管理信息系统(全套)
- 串口操作类(justinio)
- 基于Petri网的工作流(完整的原创源代
- 选择题自动考试系统
- 多线程实例:桌面智能弹球小游戏
- shp转cad小工具
- Game Physics Engine Development
- Software Engineering(10th Edition)(Globa
- unity4.0官方正式版
- Cisco Configuration Engine白皮书
- 土地信息管理系统
- ServiceStack V3.9 全部dll
- PDF pdfview.ocx 无水印
评论
共有 条评论