資源簡介
arcengine進行的二次開發的經典案例,可以實現IDW,克里金插值,。適合C#初學者,以及從事ARCGIS二次開發的初學者。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?ESRI.ArcGIS.Carto;
using?ESRI.ArcGIS.Geodatabase;
using?ESRI.ArcGIS.DataSourcesRaster;
using?ESRI.ArcGIS.Geometry;
using?ESRI.ArcGIS.SpatialAnalyst;
using?ESRI.ArcGIS.GeoAnalyst;
namespace?Interpolation
{
????public?partial?class?FrmInterpolation?:?Form
????{
????????public?FrmInterpolation()
????????{
????????????InitializeComponent();
????????}
????????private?IRasterAnalysisEnvironment?rasterEnv;//分析環境
????????private?IInterpolationOp2?interOp;//空間插值對象
????????private?IFeatureClass?feaClass;
????????private?IFeatureClassDescriptor?feaDes;
????????private?IGeoDataset?inGeodataset;//輸入柵格
????????private?IGeoDataset?outGeodataset;//輸出柵格
????????#region?環境變量
????????private?double?cellSize?=?500;//輸出像元大小
????????private?object?Missing?=?Type.Missing;
????????private?object?cellSizeObj;
????????private?object?extentProObj;//處理范圍
????????private?IRasterRadius?radius;
????????#endregion
????????#region?IDW變量
????????private?double?power;
????????#endregion
????????#region?Krige變量
????????private?esriGeoAnalysisSemiVariogramEnum?semiEnum;
????????#endregion
????????#region?Spline變量
????????private?esriGeoAnalysisSplineEnum?splineEnum;
????????#endregion
????????#region?NaturalNeighbor變量
????????#endregion
????????#region?Trend變量
????????private?esriGeoAnalysisTrendEnum?trendEnum;
????????private?int?order;
????????#endregion
???????
????????//IDW內插
????????private?void?btnIDW_Click(object?sender?EventArgs?e)
????????{
????????????try
????????????{
????????????????interOp?=?rasterEnv?as?IInterpolationOp2;
????????????????outGeodataset?=?interOp.IDW(inGeodataset?power?radius?ref?Missing);//反距離權重法
????????????????ShowResult(outGeodataset?“IDW“);//?顯示分析結果函數
????????????????MessageBox.Show(“完成“);
????????????}
????????????catch?{?}
????????}
????????//Krige插值
????????private?void?btnKrige_Click(object?sender?EventArgs?e)
????????{
????????????try
????????????{
????????????????interOp?=?rasterEnv?as?IInterpolationOp2;
????????????????//克里金插值方法
????????????????outGeodataset?=?interOp.Krige(inGeodataset?semiEnum?radius?true?ref?Missing);
????????????????ShowResult(outGeodataset?“Krige“);
????????????????MessageBox.Show(“完成“);
????????????}
????????????catch?{?}
????????}
????????//Spline插值
????????private?void?btnSpline_Click(object?sender?EventArgs?e)
????????{
????????????try
????????????{
????????????????interOp?=?rasterEnv?as?IInterpolationOp2;
????????????????outGeodataset?=?interOp.Spline(inGeodataset?splineEnum?ref?Missing?ref?Missing);
????????????????ShowResult(outGeodataset?“Spline“);
????????????????MessageBox.Show(“完成“);
????????????}
????????????catch?{?}
????????}
????????//Trend插值
????????private?void?cmdTrend_Click(object?sender?EventArgs?e)
??
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????36352??2017-10-30?19:16??8.2空間插值\code\Interpolation\bin\Debug\Interpolation.exe
?????文件??????48640??2017-10-30?19:16??8.2空間插值\code\Interpolation\bin\Debug\Interpolation.pdb
?????文件??????22984??2018-09-05?10:38??8.2空間插值\code\Interpolation\bin\Debug\Interpolation.vshost.exe
?????文件????????490??2017-09-29?21:43??8.2空間插值\code\Interpolation\bin\Debug\Interpolation.vshost.exe.manifest
?????文件??????34816??2017-10-28?13:07??8.2空間插值\code\Interpolation\bin\Release\Interpolation.exe
?????文件??????48640??2017-10-28?13:07??8.2空間插值\code\Interpolation\bin\Release\Interpolation.pdb
?????文件??????11600??2017-10-28?13:07??8.2空間插值\code\Interpolation\bin\Release\Interpolation.vshost.exe
?????文件????????490??2017-10-28?13:07??8.2空間插值\code\Interpolation\bin\Release\Interpolation.vshost.exe.manifest
?????文件??????11302??2017-10-28?13:07??8.2空間插值\code\Interpolation\FrmInterpolation.cs
?????文件??????27406??2017-10-28?13:07??8.2空間插值\code\Interpolation\FrmInterpolation.Designer.cs
?????文件??????11585??2017-10-28?13:07??8.2空間插值\code\Interpolation\FrmInterpolation.resx
?????文件???????9463??2017-10-30?19:16??8.2空間插值\code\Interpolation\Interpolation.csproj
?????文件????????452??2017-10-28?13:07??8.2空間插值\code\Interpolation\Interpolation.csproj.user
?????文件????????763??2017-10-28?13:07??8.2空間插值\code\Interpolation\LicenseInitializer.cs
?????文件??????15243??2017-10-28?13:07??8.2空間插值\code\Interpolation\LicenseInitializer.Designer.cs
?????文件?????376571??2017-10-30?19:15??8.2空間插值\code\Interpolation\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????8241??2018-09-05?10:38??8.2空間插值\code\Interpolation\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????6632??2018-09-05?10:38??8.2空間插值\code\Interpolation\obj\x86\Debug\Interpolation.csproj.FileListAbsolute.txt
?????文件????????986??2017-10-30?19:15??8.2空間插值\code\Interpolation\obj\x86\Debug\Interpolation.csproj.GenerateResource.Cache
?????文件?????624676??2017-10-30?19:16??8.2空間插值\code\Interpolation\obj\x86\Debug\Interpolation.csprojResolveAssemblyReference.cache
?????文件??????36352??2017-10-30?19:16??8.2空間插值\code\Interpolation\obj\x86\Debug\Interpolation.exe
?????文件???????4011??2017-10-30?19:16??8.2空間插值\code\Interpolation\obj\x86\Debug\Interpolation.FrmInterpolation.resources
?????文件??????48640??2017-10-30?19:16??8.2空間插值\code\Interpolation\obj\x86\Debug\Interpolation.pdb
?????文件????????180??2017-10-30?19:16??8.2空間插值\code\Interpolation\obj\x86\Debug\Interpolation.Properties.Resources.resources
?????文件?????123237??2017-10-28?13:07??8.2空間插值\code\Interpolation\obj\x86\Debug\ResolveAssemblyReference.cache
?????文件???????4608??2017-10-28?13:07??8.2空間插值\code\Interpolation\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll
?????文件?????127522??2017-10-28?13:07??8.2空間插值\code\Interpolation\obj\x86\Release\DesignTimeResolveAssemblyReferences.cache
?????文件???????7397??2017-10-28?13:07??8.2空間插值\code\Interpolation\obj\x86\Release\DesignTimeResolveAssemblyReferencesInput.cache
?????文件????????933??2017-10-28?13:07??8.2空間插值\code\Interpolation\obj\x86\Release\Interpolation.csproj.FileListAbsolute.txt
?????文件????????986??2017-10-28?13:07??8.2空間插值\code\Interpolation\obj\x86\Release\Interpolation.csproj.GenerateResource.Cache
............此處省略35個文件信息
- 上一篇:酒店管理系統C#
- 下一篇:asp.net學生成績管理系統畢業課程設計
評論
共有 條評論