资源简介
从零开始: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个文件信息
相关资源
- arcgis engine 自定义 测量 工具
- arcgis土地利用总体规划符号库
- arcgis for js 4.5 仿qq截图 地图截屏
- ChartControl控件的使用
- NB-IOT北向推送接收源码参考(电信、
- arcgis10.7.txt
- arcgis根据矢量图斑截图工具1.02.rar
- 图解vs2010发布、打包安装程序(超全
- ArcGIS_Desktop_102_134924.iso
- 有道API翻译Demo
- ARCGIS必填字段检查
- ArcEngine 图形编辑源代码
- 基于DOM-TREE网页正文提取方法
- visual studio 2017中英文企业版离线安装
- arcgis样式,部分林业样式按照制图标
- System.Net.Http.dll.rar
- arcgis server 10.4破解文件
- arcgis地质灾害符号图例
- 简单的学生宿舍管理系统
- 医院药品进销存系统
- Arcgis Engine中创建书签
- Arcgis desktopenginedeveloper.kit10.2
- 判断接收到的字节流网络流是何种编
- arcgis常见拓扑错误的修改方法
- ArcGIS Desktop 10.6.1
- one_engine53.zip
- 连接数据库并实现登录功能的
- ARCGIS 批量裁剪插件
- Webrequests模拟登录
- Unity LitJson.dll
评论
共有 条评论