資源簡介
AE+C#三維顯示,DEM加載,疊加,分層設色等
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.IO;
using?System.Drawing;
using?System.Text;
using?System.Windows.Forms;
using?ESRI.ArcGIS.Carto;
using?ESRI.ArcGIS.Analyst3D;
using?ESRI.ArcGIS.Display;
using?ESRI.ArcGIS.Geodatabase;
using?ESRI.ArcGIS.DataSourcesRaster?;
using?ESRI.ArcGIS.DataSourcesFile;
using?ESRI.ArcGIS.esriSystem?;
namespace?lesson1
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????//加載DEM數據
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????ISceneGraph?pSceneGraph?=?this.axSceneControl1.SceneGraph;
????????????IScene?pScene?=?pSceneGraph.Scene;
????????????IRasterlayer???pRasterlayer?=new?RasterlayerClass?();
????????????ilayer?player?;
????????????
????????????this.openFileDialog1.title?=“Raster?layer“;
????????????this.openFileDialog1.DefaultExt?=“.TIF“;
????????????this.openFileDialog1.Filter?=“(*.tif)|*.tif“;
????????????if?(this.openFileDialog1.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????string?pPathName?=?this.openFileDialog1.FileName;
????????????????string?pPath?=?pPathName.Substring(0?pPathName.LastIndexOf(‘\\‘));
????????????????string?fileName?=?pPathName.Substring(pPath.Length+1?pPathName.Length?-?pPath.Length-1);
????????????????IWorkspaceFactory?pwsf?=?new?RasterWorkspaceFactoryClass();
????????????????IRasterWorkspace?pRasterWorkspace;
????????????????if?(pwsf.IsWorkspace(pPath))
????????????????{
????????????????????pRasterWorkspace?=?pwsf.OpenFromFile(pPath?0)?as?IRasterWorkspace;
????????????????????IRasterDataset?pRasterDataset?=?pRasterWorkspace.OpenRasterDataset(fileName);
????????????????????//pRasterDataset.OpenFromFile(pPath);
????????????????????pRasterlayer.CreateFromDataset(pRasterDataset);
????????????????????player?=?pRasterlayer?as?ilayer;
????????????????????pScene.Addlayer(player?true);
????????????????????//pScene.ExaggerationFactor?=?6;
????????????????????pSceneGraph.RefreshViewers();
?????????????????
????????????????}
????????????}????????????
????????}
????????//加載TIN數據
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????ISceneGraph?pSceneGraph?=?this.axSceneControl1.SceneGraph;
????????????IScene?pScene?=?pSceneGraph.Scene;
????????????ITinlayer?tinlayer?=?new?TinlayerClass();
????????????ilayer?player;
????????????FileInfo?fileInfo;
????????????string?tinPath;
????????????IWorkspaceFactory?tinWorkspaceFactory?=?new?TinWorkspaceFactoryClass();
????????????ITinWorkspace?tinWorkspace;
????????????ITin?tin;
????????????
????????????if?(this.folderBrowserDialog1.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????tinPath?=?this.folderBrowserDialog1.SelectedPath;
????????????????fileInfo?=??new?FileInfo(tinPath);
????????????????if?(tinWorkspaceFactory.IsWorkspace(fileInfo.Directo
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????33367??2003-05-12?07:53??lesson1\data\Exercise1\Data\dvim3.aux
?????文件?????368783??2000-10-29?20:13??lesson1\data\Exercise1\Data\dvim3.rrd
?????文件????????222??2000-03-23?10:18??lesson1\data\Exercise1\Data\dvim3.tfw
?????文件????4303472??2000-10-29?20:13??lesson1\data\Exercise1\Data\dvim3.TIF
?????文件?????120355??2002-03-01?10:48??lesson1\data\Exercise1\Data\dvim3.TIF.xm
?????文件?????131636??2002-03-01?10:48??lesson1\data\Exercise1\Data\workspace1\dvtin\me
?????文件????????104??2000-10-12?10:52??lesson1\data\Exercise1\Data\workspace1\dvtin\tdenv.adf
?????文件??????33528??2000-10-12?10:52??lesson1\data\Exercise1\Data\workspace1\dvtin\tedg.adf
?????文件???????1040??2000-10-12?10:52??lesson1\data\Exercise1\Data\workspace1\dvtin\thul.adf
?????文件????????484??2009-11-22?16:22??lesson1\data\Exercise1\Data\workspace1\dvtin\tmsk.adf
?????文件????????116??2009-11-22?16:22??lesson1\data\Exercise1\Data\workspace1\dvtin\tmsx.adf
?????文件??????33528??2000-10-12?10:52??lesson1\data\Exercise1\Data\workspace1\dvtin\tnod.adf
?????文件??????22400??2000-10-12?10:52??lesson1\data\Exercise1\Data\workspace1\dvtin\tnxy.adf
?????文件???????5600??2000-10-12?10:52??lesson1\data\Exercise1\Data\workspace1\dvtin\tnz.adf
?????文件???????1140??2000-06-16?11:39??lesson1\data\Exercise1\Data\workspace1\info\arc.dir
?????文件??????12800??2000-10-12?09:49??lesson1\data\Exercise1\Death?Valley?Terrain.lyr
?????文件?????127032??2002-03-01?10:48??lesson1\data\Exercise1\Death?Valley?Terrain.lyr.xm
?????文件????????218??2001-02-02?14:59??lesson1\data\Exercise1\Readme.txt
?????文件?????????35??2003-06-27?16:56??lesson1\data\Exercise1\schema.ini
?????文件??????65024??2009-08-12?02:44??lesson1\data\test.sxd
?????文件????????140??2009-08-02?22:43??lesson1\data\tin\prj.adf
?????文件????????104??2009-08-02?22:48??lesson1\data\tin\tdenv.adf
?????文件??????87072??2009-08-02?22:48??lesson1\data\tin\tedg.adf
?????文件???????2500??2009-08-02?22:48??lesson1\data\tin\thul.adf
?????文件???????1040??2009-11-22?16:20??lesson1\data\tin\tmsk.adf
?????文件????????116??2009-11-22?16:20??lesson1\data\tin\tmsx.adf
?????文件??????87072??2009-08-02?22:48??lesson1\data\tin\tnod.adf
?????文件??????58096??2009-08-02?22:48??lesson1\data\tin\tnxy.adf
?????文件??????14524??2009-08-02?22:48??lesson1\data\tin\tnz.adf
?????文件??????28672??2009-11-22?16:19??lesson1\lesson1\bin\Debug\lesson1.exe
............此處省略262個文件信息
評論
共有 條評論