窗体设计:

代码:

private void button_src_Click(object sender, EventArgs e)
{

OpenFileDialog openFile = new OpenFileDialog();
openFile.Title = "请选择待校正影像";
openFile.Multiselect = false;
if (openFile.ShowDialog() != DialogResult.OK) return;

if (m_SrcLayer != null) mapControl_src.FocusMap.DeleteLayer(m_SrcLayer);
m_SrcLayer = LayerFactory.CreateDefaultLayer(openFile.FileName);
if (m_SrcLayer == null) return;

//添加图层
mapControl_src.FocusMap.AddLayer(m_SrcLayer);
mapControl_src.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
textBox_srcImg.Text = openFile.FileName;
}

private void button_dst_Click(object sender, EventArgs e)
{
SaveFileDialog saveFile = new SaveFileDialog();
saveFile.Filter = "栅格影像|*.tiff;*.tif";
if (saveFile.ShowDialog() != DialogResult.OK) return;

textBox_dst.Text = saveFile.FileName;
}

private void button_run_Click(object sender, EventArgs e)
{
//string inFile = textBox_srcImg.Text;
//string outFile = textBox_dst.Text;
/// <summary>
///大气校正算法测试,本算法实现了将GF1_PMS1_E116.5_N39.4_20131127_L1A0000117600-MSS1.tiff进行大气校正
///大气模式为系统自动选择大气模式,气溶胶类型为大陆性气溶胶,初始能见度为40km,逐项元反演气溶胶为是
/// </summary>
#region 1、参数设置
PIE.CommonAlgo.DataProcess_AtmCor_Info info = new PIE.CommonAlgo.DataProcess_AtmCor_Info();

info.InputFile = textBox_srcImg.Text;
info.InputXML = textBox1.Text ;
info.OutputSR = textBox_dst.Text ;

info.AtmModel = comboBox1.SelectedIndex;
info.AerosolType = comboBox2.SelectedIndex+1;

info.InitialVIS = Convert.ToInt32(textBox2.Text ) ;
//info.AeroRetrieval = comboBox3.SelectedIndex;
if (comboBox3.Text == "是")
{
info.AeroRetrieval = 1;
}
else if (comboBox3.Text == "否")
{
info.AeroRetrieval = 0;
}
else
{
MessageBox.Show("请选择逐像元反演气溶胶");
}
info.FileTypeCode = "Gtiff";
if (checkBox1.Checked == true)
{
info.DataType = 1;
}
else if (checkBox2.Checked == true)
{
info .DataType =2;
}
else if (checkBox3.Checked == true)
{
info .DataType =3;
}
else
{
MessageBox .Show("请选择数据类型!");
}

PIE.SystemAlgo.ISystemAlgo algo = PIE.SystemAlgo.AlgoFactory.Instance().CreateAlgo("PIE.CommonAlgo.dll", "PIE.CommonAlgo.AtmosphericCorrectionAlgo");
if (algo == null) return;
#endregion

//2、算法执行
PIE.SystemAlgo.ISystemAlgoEvents algoEvents = algo as PIE.SystemAlgo.ISystemAlgoEvents;
algo.Name = "大气校正";
algo.Params = info;
bool result = PIE.SystemAlgo.AlgoFactory.Instance().ExecuteAlgo(algo);

//添加图层
String filePath = textBox_dst.Text;
ILayer layer = PIE.Carto.LayerFactory.CreateDefaultLayer(filePath);
mapControl_dst.ActiveView.FocusMap.AddLayer(layer);
mapControl_dst.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);
}

private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
// checkBox1.Text = "1";
}

private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
// checkBox2.Text = "2";
}

private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
// checkBox3.Text = "3";
}

private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog openFile = new OpenFileDialog();
openFile.Filter = "xml数据|*.XML;*.XML";
if (openFile.ShowDialog() != DialogResult.OK)
return;
//OpenFileDialog openFile = new OpenFileDialog();
//openFile.Title = "请选择元数据文件";
//openFile.Multiselect = false;
//if (openFile.ShowDialog() != DialogResult.OK) return;
//添加图层

// mapControl_src.FocusMap.AddLayer(m_SrcLayer);
// mapControl_src.ActiveView.PartialRefresh(ViewDrawPhaseType.ViewAll);

textBox1.Text = openFile.FileName;

}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
/*if (comboBox1.Text == "系统自动选择大气模式")
{
comboBox1.SelectedIndex = 0;
}
else if (comboBox1.Text == "热带大气模式")
{
comboBox1.SelectedIndex = 1;
}
else if (comboBox1.Text == "中纬度夏季大气模式")
{
comboBox1.SelectedIndex = 2;
}
else if (comboBox1.Text == "中纬度冬季大气模式")
{
comboBox1.SelectedIndex = 3;
}
else if (comboBox1.Text == "副极地夏季大气模式")
{
comboBox1.SelectedIndex = 4;
}
else if (comboBox1.Text == "副极地冬季大气模式")
{
comboBox1.SelectedIndex = 5;
}
else if (comboBox1.Text == "美国1962大气模式")
{
comboBox1.SelectedIndex = 6;
}
/*else
{
MessageBox.Show("请选择大气模式");
}*/

}

private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
/* if (comboBox2.Text == "大陆型气溶胶")
{
comboBox2.SelectedIndex = 1;
}
else if (comboBox2.Text == "海洋型气溶胶")
{
comboBox2.SelectedIndex = 2;
}
else if (comboBox2.Text == "城市型气溶胶")
{
comboBox2.SelectedIndex = 3;
}
else if (comboBox2.Text == "沙尘型气溶胶")
{
comboBox2.SelectedIndex = 4;
}
else if (comboBox2.Text == "煤烟型气溶胶")
{
comboBox2.SelectedIndex = 5;
}
else if (comboBox2.Text == "平流层型气溶胶")
{
comboBox2.SelectedIndex = 6;
}
/* else
{
MessageBox.Show("请选择气溶胶类型");
}*/
}

private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
{
/* if (comboBox3.Text == "是")
{
comboBox3.SelectedIndex = 1;
}
else
{
comboBox3.SelectedIndex = 0;
}*/
}

private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 0x20) e.KeyChar = (char)0; //禁止空格键
if ((e.KeyChar == 0x2D) && (((TextBox)sender).Text.Length == 0)) return; //处理负数
if (e.KeyChar > 0x20)
{
try
{
double.Parse(((TextBox)sender).Text + e.KeyChar.ToString());
}
catch
{
e.KeyChar = (char)0; //处理非法字符
}
}

}

}

PIE二次开发——大气校正的更多相关文章

  1. PIE SDK大气校正

    1. 算法功能简介 大气校正的目的消除大气对太阳和来自目标的辐射产生吸收和散射作用的 影响,从而获得目标反射率.辐射率.地表温度等真实物理模型参数.大多数情 况下,大气校正同时也是反演地物真实反射率的 ...

  2. PIE 插件式开发小笔记__PIESDK学习体会

    基于PIE.NET-SDK插件式二次开发文档笔记:  PIE 插件式开发配置文件: 它里面一行如下:      理解上一行'Item'关系->    library:为插件类名(程序集名称+后缀 ...

  3. PIESDKDoNet二次开发配置注意事项

    在安装完PIESDK进行二次开发的过程中会遇到下面几种常见的开发配置问题,就写一个文档总结一下. 1.    新建项目无PIESDK模板问题 关于新建项目时候,找不到下图中的PIEMainApplic ...

  4. PIESDK二次开发基础视频

    第0讲:PIESDKNet二次开发环境配置 第1讲:PIE产品简介及开发介绍 第2讲:PIE架构及常用控件介绍 第3讲:PIESDK常用功能实践 第4讲:XML插件配置及组件式开发界面搭建 第5讲:地 ...

  5. Navisworks API 简单二次开发 (自定义工具条)

    在Navisworks软件运行的时候界面右侧有个工具条.比较方便.但是在二次开发的时候我不知道在Api那里调用.如果有网友知道请告诉我.谢谢. 我用就自己设置一个工具.界面比较丑!没有美工. 代码: ...

  6. [连载]《C#通讯(串口和网络)框架的设计与实现》- 12.二次开发及应用

    目       录 第十二章     二次开发及应用... 2 12.1        项目配制... 3 12.2        引用相关组件... 4 12.3        构建主程序... 5 ...

  7. OBS-Studio二次开发记录

    OBS-Studio 是一款跨平台的,开源的视频直播客户端软件. 公司需要对他进行二次开发,开发的目的是使用它的录屏功能. 开发的要求是:定制全新的界面,所见即所得,window系统兼容要好. 开发步 ...

  8. 小猪cms微信二次开发之怎样分页

    $db=D('Classify'); $zid=$db->where(array('id'=>$this->_GET('fid'),'token'=>$this->tok ...

  9. 承接 AutoCAD 二次开发 项目

    本人有多年的CAD开发经验,独立完成多个CAD二次开发项目.熟悉.net及Asp.net开发技术,和Lisp开发技术. 现在成立了工作室,独立承接CAD二次开发项目.结项后提供源码及开发文档,有需要的 ...

随机推荐

  1. SQL Server 查找空值

    需要查找某一列为空的数据 )NULL不能用 “=”运算符 )NULL不支持+-*/ <> )不同的函数对NULL的支持不一样,使用前要测试,不能靠猜,不能凭经验

  2. Android命名规范(重点讲解:包名)

    Android程序开发中,使用规范的命名有益于程序的开发和后期阅读.本文主要对Android程序包名的定义做详细介绍,并附带一些简单的命名规则. 一.标识符命名方法1 .小驼峰命名法,除首单词外,其余 ...

  3. MySQL 正则(Regular Expression) 邮箱(Email)

    MySQL 正则表达式 | 菜鸟教程https://www.runoob.com/mysql/mysql-regexp.html (1条消息)常用正则表达式—邮箱(Email) - Samuel - ...

  4. disruptor 单生产者多消费者

    demo1 单生产者多消费者创建. maven 依赖 <!-- https://mvnrepository.com/artifact/com.lmax/disruptor --> < ...

  5. spark sql插入表时的文件个数研究

    spark sql执行insert overwrite table时,写到新表或者新分区的文件个数,有可能是200个,也有可能是任意个,为什么会有这种差别? 首先看一下spark sql执行inser ...

  6. WPF ContextMenu DataTemplate MenuItem Visibility 问题

    问题: ContextMenu 的 DataTemplate 中 MenuItem 设置 Visibility 不起作用 需要添加一下样式才可以: <ContextMenu.ItemContai ...

  7. linux非root用户安装jdk1.8

    如题,先到 Oracle 官方网站 下载1.8版本的 JDK 压缩包(jdk-8u221-linux-x64.tar.gz)到本地(如D盘的soft目录),然后开始进入linux的非root用户(如w ...

  8. Spring Cloud Ribbon 客户端负载均衡 4.3

      在分布式架构中,服务器端负载均衡通常是由Nginx实现分发请求的,而客户端的同一个实例部署在多个应用上时,也需要实现负载均衡.那么Spring Cloud中是否提供了这种负载均衡的功能呢?答案是肯 ...

  9. spring @Transactional的自调用失效问题与事务的典型错误用法剖析

    @Transactional的自调用失效问题 有时候配置了注解@Transactional,但是它会失效,这里要注意一些细节问题,以避免落入陷阱. 注解@Transaction的底层实现是Spring ...

  10. LeetCode_303. Range Sum Query - Immutable

    303. Range Sum Query - Immutable Easy Given an integer array nums, find the sum of the elements betw ...