没有合适的资源?快使用搜索试试~ 我知道了~
C#语言实现从读取栅格数据中每个栅格的数据
需积分: 50 52 下载量 92 浏览量
2018-12-14
04:15:54
上传
评论 2
收藏 7KB TXT 举报
温馨提示
试读
7页
挨个读取栅格数据中每一个像素点的数值,并且可以根据需要输出成其它格式数据。
资源推荐
资源详情
资源评论
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.Analyst3D;
using CsGL.OpenGL;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Carto;
using System.Reflection;
using System.IO;
using ESRI.ArcGIS.DataSourcesRaster;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.GeoAnalyst;
//using ESRI.ArcGIS.Utility;
using ESRI.ArcGIS.GlobeCore;
using OERS.BaseUtil;
namespace SceneTest
{
public partial class Draw1
{
public class point
{
public float X;
public float Y;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ESRI.ArcGIS.Analyst3D;
using CsGL.OpenGL;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Carto;
using System.Reflection;
using System.IO;
using ESRI.ArcGIS.DataSourcesRaster;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.GeoAnalyst;
//using ESRI.ArcGIS.Utility;
using ESRI.ArcGIS.GlobeCore;
using OERS.BaseUtil;
namespace SceneTest
{
public partial class Draw1
{
public class point
{
public float X;
public float Y;
public float Z;
public point(float X, float Y, float Z)
{
this.X = X;
this.Y = Y;
this.Z = Z;
}
}
//private ESRI.ArcGIS.Controls.AxSceneControl axSceneControl1;
public point[,] ptList;
public int XNum;
public int YNum;
public float MinZ = 0.0f;
public void CreateBathScene()
{
IRasterLayer RasterLy = (IRasterLayer)OERS.BaseUtil.ReferenceTheInstances.MYWorldBaseLayer;
#region 获取像素值
IRasterProps rasterProps = (IRasterProps)RasterLy.Raster;
int dHeight = rasterProps.Height;//当前栅格数据集的行数
int dWidth = rasterProps.Width; //当前栅格数据集的列数
ptList = new point[dHeight, dWidth];
double dX = rasterProps.MeanCellSize().X; //栅格的宽度
double dY = rasterProps.MeanCellSize().Y; //栅格的高度
IEnvelope extent = rasterProps.Extent; //当前栅格数据集的范围
public point(float X, float Y, float Z)
{
this.X = X;
this.Y = Y;
this.Z = Z;
}
}
//private ESRI.ArcGIS.Controls.AxSceneControl axSceneControl1;
public point[,] ptList;
public int XNum;
public int YNum;
public float MinZ = 0.0f;
public void CreateBathScene()
{
IRasterLayer RasterLy = (IRasterLayer)OERS.BaseUtil.ReferenceTheInstances.MYWorldBaseLayer;
#region 获取像素值
IRasterProps rasterProps = (IRasterProps)RasterLy.Raster;
int dHeight = rasterProps.Height;//当前栅格数据集的行数
int dWidth = rasterProps.Width; //当前栅格数据集的列数
ptList = new point[dHeight, dWidth];
double dX = rasterProps.MeanCellSize().X; //栅格的宽度
double dY = rasterProps.MeanCellSize().Y; //栅格的高度
IEnvelope extent = rasterProps.Extent; //当前栅格数据集的范围
剩余6页未读,继续阅读
资源评论
呜喵王·文和
- 粉丝: 1
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功