• ArcGIS Engine的栅格数据分析


    之前,一般只用ArcGISEngine读取shp矢量数据。。。那么ArcGISEngine如何读取栅格数据呢?

    参考:https://www.cnblogs.com/yhlx125/p/2563095.html

    1) RasterDataset:(栅格数据集)

    The RasterDataset class represents a raster dataset stored in a storage media, file system, geodatabase, or in memory. RasterDataset is a file raster dataset if it is opened from a file system or a personal geodatabase, and it is a database raster dataset if it is opened from a file geodatabase or an ArcSDE geodatabase. A raster dataset in an unmanaged raster catalog, where raster datasets are stored in a file system, is also a file raster dataset. ArcGIS allows you to create an in-memory RasterDataset where the pixels are stored in memory. This type of raster dataset has the characteristics of a file raster dataset. A file raster dataset and a geodatabase raster dataset behave the same except for some minor differences.

    栅格数据集类表示存储在储存媒介、文件系统、geodatabase或者是在内存中的栅格数据集。如果它是从文件系统或者个人数据库种打开的,那么RasterDataset是一个文件栅格数据集。如果它是从文件数据库或者是ArcSDE地理数据库种打开的,那么RasterDataset是一个数据库栅格数据集。在一个非管理的栅格目录中的栅格数据集,其中栅格数据集存储在文件系统中,也是一个文件栅格数据集。ArcGIS允许你创建一个内存中的RasterDataset,其中像素点都是存储在内存中的。这类的栅格数据集具有文件栅格数据集的特征。文件栅格数据集和地理数据库栅格数据集表现起来是一样的,除了一些细微的差异。

    Creating raster datasets in various workspaces requires specifying the properties of the raster data to be created as well as the properties of the storage container. In an ArcSDE geodatabase, raster data is stored as a set of database management system (DBMS) tables that are used to manage the pixel values, pyramids, and other auxiliary information. The pixels of raster data are divided into small tiles, and each tile is stored as a binary large object (BLOB) in a row of the block table. The raster column in the business table defines the properties of the raster dataset, and the geometry column defines properties of the footprint of the raster dataset. A file geodatabase raster has a similar implementation as an ArcSDE geodatabase. The only difference is that raster data is stored as a set of file geodatabase tables in the file system instead of in a relational geodatabase.

    在不同的工作空间中创建光栅数据集不光需要指定存储容器的属性,还需要指定要创建的光栅数据的属性。在ArcSDE地理数据库中,光栅数据存储为一组数据库管理系统(DBMS)表,用于管理像素值、金字塔和其他辅助信息。光栅数据的像素被划分为小块,每个小块作为二进制大对象(BLOB)存储在块表的一行中。业务表中的“raster”列定义了光栅数据集的属性,“geometry”列定义了光栅数据集的footprint特性。文件地理数据库光栅具有与ArcSDE地理数据库类似的实现。唯一的区别是,光栅数据作为一组文件地理数据库表存储在文件系统中,而不是存储在关系地理数据库中。

    IRasterWorkspaceEx is used to create a raster dataset and a raster catalog in a geodatabase. When creating data in a geodatabase, RasterDef can be used to set the properties of the raster field, and RasterStorageDef can be used to specify the storage properties such as tile size, cell size, pyramid origin, and compression. Because raster data in a personal geodatabase is implemented by converting it to an IMAGINE file format and managing it in the personal geodatabase, only some of the raster storage properties apply to a personal geodatabase (such as cell size and compression).

    使用IRasterWorkspaceEx来在地理数据库中创建栅格数据集和栅格目录。当在地理数据库中创建数据时,RasterDef可以用来定义raster field的属性,而RasterStorageDef可以用来定义存储属性,例如切片大小。由于个人地理数据库中的光栅数据是通过将其转换为IMAGINE文件格式并在个人地理数据库中进行管理来实现的,因此只有一些光栅存储属性适用于个人地理数据库(例如单元大小和压缩)。

    Creating a geodatabase raster dataset using IRasterWorkspaceEx initially creates an empty raster dataset, which servers as a placeholder for the specified properties of the raster dataset. The extent and pixel values of the dataset can be populated by mosaicking from other raster dataset or, alternatively, writing using PixelBlock.

    使用IRasterWorkspaceEx创建地理数据库光栅数据集最初会创建一个空的光栅数据集,该数据集作为光栅数据集指定属性的占位符。数据集的范围和像素值可以通过从其他光栅数据集拼接或使用PixelBlock写入来填充。

    To create a raster dataset in any supported file raster format using IRasterWorkspace2, the origin, number of bands, pixel type, width, and height of the raster dataset must be specified along with other required parameters. The created raster dataset has a specified dimension and a default pixel value. The default pixel value is normally the maximum value of the specified pixel type and can be populated by writing pixel blocks. If IRasterWorkspace2 is used to create a geodatabase raster dataset, the default storage parameters are used.

    要使用IRasterWorkspace2以任何受支持的文件光栅格式创建光栅数据集,必须指定光栅数据集的原点、带区数、像素类型、宽度和高度以及其他必需的参数。创建的光栅数据集具有指定的维度和默认像素值。默认像素值通常是指定像素类型的最大值,可以通过写入像素块来填充。如果使用IRasterWorkspace2创建地理数据库光栅数据集,则使用默认存储参数。

    2) Raster 栅格

    The Raster class, in contrast to the static RasterDataset and RasterBand classes, is transient in nature and can be modified without affecting the source data. This allows the raster to represent what you want—for example, you can set a transformation or a pixel filter on a raster, specify a projection or extent, and set other properties without changing the raster dataset. If you want to persist change, the modified raster can be saved to another raster dataset using the ISaveAs interface.

    栅格类,与静态的RasterDataset和RasterBand类不同,本质上是暂时的,可以被修改,但是并不影响原始数据。这允许栅格类对象来表示你需要的——例如,你可以在栅格上设置一个转换或者是像素过滤器,指定一个投影或范围,并且设置其他的属性,而不用改变栅格数据集。如果你想要将更新持久化保存,修改后的Raster类对象可以通过使用ISaveAs接口来保存到另一个栅格数据集。

    Although Raster is always transient in nature, it must be associated with one or more raster bands, which provides a source for the data to be read through the raster. As such, the Raster is most easily understood as a vehicle to provide resampling, transformation, and data type conversion from one or more raster bands to a desired output coordinate system.

    尽管Raster类对象在本质上始终是瞬态的,但它必须与一个或多个光栅band带相关联,它为通过Raster类读取数据提供了一个源。因此,Raster理解为一个交通工具,提供从一个或多个光栅band到所需输出坐标系的重采样、转换和数据类型转换。

    3) RasterBand栅格波段

    A representation of a single band of a raster dataset on disk.

    表示在硬盘上存储的栅格数据集的单个波段。

    RasterBand is a non-creatable object. References to non-creatable objects must be obtained through other objects.

    RasterBand是不可创建的对象。对不可创建对象的引用必须通过其他对象获得。

    The RasterBand object represents an existing band of a raster dataset. This band may be the only band in a single raster dataset or one band in a multiband raster dataset.

    RasterBand对象表示在一个栅格数据集中的一个存在的波段。该波段可能是一个栅格数据集中的唯一波段,或者是一个多波段数据中的一个波段。

    A RasterBand can be obtained from a RasterDataset or a Raster using IRasterBandCollection::Item.

    RasterBand可以通过RasterDataset获取,或者是使用IRasterBandCollection::Item从Raster对象中获取。

    The RasterBand class represents an existing band of a raster dataset. You can access a RasterBand of a Raster or a RasterDataset. Regardless of whether it is derived from the static RasterDataset or the transient Raster, the RasterBand always represents a static band of raster data.

    RasterBand类表示光栅数据集的现有波段。您可以从Raster类或者RasterDataset中获取RasterBand。无论它是不是从静态的光栅数据集还是从瞬态Raster对象中派生,RasterBand始终表示光栅数据的静态波段。

    The IRasterBand interface provides access to the raster color map, histogram, statistics, and attribute table if they exist. 

    IRasterBand接口提供对光栅颜色图、直方图、统计信息和属性表(如果存在)的访问。

    4) Pixel blocks像素块

    The PixelBlock class is a container for pixel arrays. It has the properties of width, height, pixel type, and number of planes. Each plane is a pixel array corresponding to one raster band. The PixelBlock class can handle generic pixel arrays from any raster data source. To support different pixel types, PixelBlock transports pixels in a SafeArray, which can contain many different data types.

    PixelBlock类是像素阵列的容器。它具有宽度、高度、像素类型和平面数等属性。每个平面是对应于一个光栅带的像素阵列。PixelBlock类可以处理来自任何光栅数据源的通用像素阵列。为了支持不同的像素类型,PixelBlock在安全阵列中传输像素,该阵列可以包含许多不同的数据类型。

    The PixelBlock class is used to read, modify, and write pixel values or a portion of pixel values of the raster data. Create a pixel block from a raster using the IRaster.CreatePixelBlock method. This initializes the size and other properties of the pixel block. Use the IRaster.Read method to read the pixel values into the pixel block, then use IPixelBlock3.PixelData or PixelDataByRef to get or modify the pixel values of the pixel block. The IRasterEdit interface can be used to write the pixel block to the raster dataset.

    PixelBlock类用于读取、修改和写入光栅数据的像素值或部分像素值。使用IRaster.CreatePixelBlock方法从光栅创建像素块。这将初始化像素块的大小和其他属性。使用IRaster.Read方法将像素值读取到像素块中,然后使用IPixelBlock3.PixelData或PixelDataByRef,以获取或修改像素块的像素值。IRasterEdit接口可用于将像素块写入光栅数据集。

    理解AE和GDAL的类似要从PixelBlock和RasterIO函数说起。

    参考:https://wenku.baidu.com/view/082e48a1ad1ffc4ffe4733687e21af45b307feb0.html

     https://wenku.baidu.com/view/b1a4450f5a0102020740be1e650e52ea5518cec5.html

    https://zhuanlan.zhihu.com/p/450080263

  • 相关阅读:
    window.open的火狐、谷歌兼容写法
    一个分数怎样约分?想知道的速度了。。。
    这是第二道题内容要求写一个银行的ATM系统 这个浪费了好长时间 ,遇到了许多问题,不过都解决了,上程序
    两个有理数相加(要求输入时以分数形式,输出时也以分数形式)
    linux centos 7.5下 源码编译安装 lua环境
    SecureCRT 6.7 vim高亮
    C#第一章笔记
    HTML5考试错题
    第九章博客
    第八章博客
  • 原文地址:https://www.cnblogs.com/2008nmj/p/16312336.html
Copyright © 2020-2023  润新知