资源简介
C#+ArcEngine:shp矢量点转栅格(VS2010窗体+代码)。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.DataSourcesFile;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.GeoAnalyst;
using ESRI.ArcGIS.DataSourcesRaster;
namespace ShpPointToRaster
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
//Shp点路径
private void btnShp_Click(object sender EventArgs e)
{
//打开shp
this.axMapControl1.Clearlayers();//先清空当前
OpenFileDialog xjShpOpenFileDialog = new OpenFileDialog();
xjShpOpenFileDialog.title = “打开矢量数据“;
xjShpOpenFileDialog.Filter = “矢量文件(*.shp)|*.shp“;
if (xjShpOpenFileDialog.ShowDialog() == DialogResult.OK)
{
string ShpFullPath = xjShpOpenFileDialog.FileName;
string ShpFolder = System.IO.Path.GetDirectoryName(ShpFullPath);
string ShpFileName = System.IO.Path.GetFileName(ShpFullPath);
this.txtShp.Text = ShpFullPath;
//工作工厂+工作空间
IWorkspaceFactory ShpWsF = new ShapefileWorkspaceFactory();//using Geodatabase + DataSourcesFile
IWorkspace ShpWs = ShpWsF.OpenFromFile(ShpFolder 0);
//IFeatureWorkspace ShpFWs = (IFeatureWorkspace)ShpWsF.OpenFromFile(ShpFolder 0);
IFeatureWorkspace ShpFWs = (IFeatureWorkspace)ShpWs;
IFeatureClass ShpFeatureClass = ShpFWs.OpenFeatureClass(ShpFileName);
IFeaturelayer ShpFeaturelayer = new Featurelayer();//引用Carto
ShpFeaturelayer.FeatureClass = ShpFeatureClass;
ShpFeaturelayer.Name = ShpFeatureClass.AliasName;
//加载刷新
this.axMapControl1.Addlayer(ShpFeaturelayer);
this.axMapControl1.ActiveView.Refresh();
//字段
this.cmbField.Items.Clear();//清空选项
int FieldCount = ShpFeatureClass.Fields.FieldCount;
for (int i = 0; i < FieldCount; i++)
{
this.cmbField.Items.Add(ShpFeatureClass.Fields.get_Field(i).Name);
}
}
}
//设置输出栅格路径
private void btnRaster_Click(object sender EventArgs e)
{
SaveFileDialog xjRasterSaveFileDialog = new SaveFileDialog();
xjRasterSaveFileDialog.Filter = “栅格文件(*.tiff)|*.tiff“;
if (xjRasterSaveFileDialog.ShowDialog() == DialogResult.OK)
{
this.txtRaster.Text = xjRasterSaveFileDialog.FileName;
}
}
//转换
private void btnTransform_Click(object sender EventArgs e)
{
string xjShp
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 760 2018-05-07 21:54 ShpPointToRaster\ShpPointToRaster\bin\Debug\info\arc.dir
文件 19968 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\bin\Debug\ShpPointToRaster.exe
文件 28160 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\bin\Debug\ShpPointToRaster.pdb
文件 11600 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\bin\Debug\ShpPointToRaster.vshost.exe
文件 490 2015-07-10 19:01 ShpPointToRaster\ShpPointToRaster\bin\Debug\ShpPointToRaster.vshost.exe.manifest
文件 5264 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\MainForm.cs
文件 9869 2018-05-03 22:23 ShpPointToRaster\ShpPointToRaster\MainForm.Designer.cs
文件 9950 2018-05-03 22:23 ShpPointToRaster\ShpPointToRaster\MainForm.resx
文件 126808 2018-05-02 22:30 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7561 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 1069 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\ShpPointToRaster.csproj.FileListAbsolute.txt
文件 978 2018-05-03 22:27 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\ShpPointToRaster.csproj.GenerateResource.Cache
文件 88456 2018-05-03 22:13 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\ShpPointToRaster.csprojResolveAssemblyReference.cache
文件 19968 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\ShpPointToRaster.exe
文件 2874 2018-05-03 22:27 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\ShpPointToRaster.MainForm.resources
文件 28160 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\ShpPointToRaster.pdb
文件 180 2018-05-03 22:27 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\ShpPointToRaster.Properties.Resources.resources
文件 591 2018-05-02 22:25 ShpPointToRaster\ShpPointToRaster\Program.cs
文件 1364 2018-05-02 22:18 ShpPointToRaster\ShpPointToRaster\Properties\AssemblyInfo.cs
文件 2884 2018-05-02 22:18 ShpPointToRaster\ShpPointToRaster\Properties\Resources.Designer.cs
文件 5612 2018-05-02 22:18 ShpPointToRaster\ShpPointToRaster\Properties\Resources.resx
文件 1103 2018-05-02 22:18 ShpPointToRaster\ShpPointToRaster\Properties\Settings.Designer.cs
文件 249 2018-05-02 22:18 ShpPointToRaster\ShpPointToRaster\Properties\Settings.settings
文件 6679 2018-05-03 22:27 ShpPointToRaster\ShpPointToRaster\ShpPointToRaster.csproj
文件 890 2018-05-02 22:18 ShpPointToRaster\ShpPointToRaster.sln
..A..H. 27648 2018-05-07 22:00 ShpPointToRaster\ShpPointToRaster.suo
目录 0 2018-05-02 22:18 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug\TempPE
目录 0 2018-05-07 21:54 ShpPointToRaster\ShpPointToRaster\bin\Debug\info
目录 0 2018-05-07 21:59 ShpPointToRaster\ShpPointToRaster\obj\x86\Debug
目录 0 2018-05-07 21:54 ShpPointToRaster\ShpPointToRaster\bin\Debug
............此处省略10个文件信息
相关资源
- C#+ArcEngine:txt坐标数据转Shp矢量点
- C# Winform,FX3U-32M,FX3u-ENET-ADP,MC协议
- C#五子棋源代码wuziqi
- AES加密解密算法程序和源代码 C#实现
- RDLC动态生成官方
- C# HttpHelper.cs
- 教务管理系统asp.net+c#+sql server2005
- 用c#编写的温度采集上位机程序
- C#中GDI+实现简单二维矢量图编辑器教
- C#简易图片编辑器 vs2010
- c#datagridview小票打印单据存储
- C# 程序自动远程更新
- C#单链表图形界面
- KNN算法C#例程
- C#调用matlab 源代码 csdn
- C#WPF 右键菜单 显示 事件触发 测试
- SevenZipSharp.dll和7z.dll
- C# Json转换DataTable源文件
- C# 动态链接机制 插件平台AppDomain对
- 利用C#打开EXCEL并将数据更新保
- C# 异步Socket 多人聊天室完整源码
- C#中读取Excel表格数据
- Winform 画多边形
- 中兴华为C#编码规范
- C# winform Socket 即时通讯
- C#textbox下拉提示 textbox智能提示 te
- C#连接oracle数据库增删改查
- 基于GPRS的远程通讯C#程序SOCKET部分带
- C# winform 单击与双击事件同时存在
- c#+vs2005的局域网抢答器
评论
共有 条评论