【GDAL】聊聊GDAL的数据模型(二)——Band对象
在GDAL中栅格数据直接参与各种计算的重要对象是Band
摘录官方描述:
Raster Band
A raster band is represented in GDAL with the GDALRasterBand class. It represents a single raster band/channel/layer. It does not necessarily represent a whole image. For instance, a 24bit RGB image would normally be represented as a dataset with three bands, one for red, one for green and one for blue.
Gdal 中数据以Dataset为基础,具体的栅格数据值被存储在这个Dataset的Band对象之中,一个Dataset可以存储多个Band对象。例如RGB色彩模型的图象,在GDAL的数据模型中被认为是一个拥有3个波段(分别对应R\G\B)的Dataset。
A raster band has the following properties:
A width and height in pixels and lines. This is the same as that defined for the dataset, if this is a full resolution band.
该值在C#中通过Band.XSize, Band.YSize获取
A datatype (GDALDataType). One of Byte, UInt16, Int16, UInt32, Int32, Float32, Float64, and the complex types CInt16, CInt32, CFloat32, and CFloat64.
A block size. This is a preferred (efficient) access chunk size. For tiled images this will be one tile. For scanline oriented images this will normally be one scanline.
A list of name/value pair metadata in the same format as the dataset, but of information that is potentially specific to this band.
实际上是以String[]方式存储的(这是C/C++程序员的习惯做法),猜测该matadata即是Dataset中获取的metadata内容一致,且不全面。
An optional description string.
An optional single nodata pixel value (see also NODATA_VALUES metadata on the dataset for multi-band style nodata values).
在C#中Nodata是对band而言的,理论上如果一个Dataset包含多个Band对象,这些Band对象的Nodata值是不能保证一致的。所以需要分别获取。另外需要注意的一点是,在创建要写入数据的Dataset时,为其Band指定Nodata需要考虑这个数据本身的有效值范围和DataType,设置合适的值。
An optional nodata mask band marking pixels as nodata or in some cases transparency as discussed in RFC 15: Band Masks.
An optional list of category names (effectively class names in a thematic image).
An optional minimum and maximum value.
该值用于获取Band中数据的最大最小统计值,不过测试了下偶尔会出现统计值不正确的情况,建议自己写方法来处理。
An optional offset and scale for transforming raster values into meaning full values (i.e. translate height to meters).
An optional raster unit name. For instance, this might indicate linear units for elevation data.
A color interpretation for the band. This is one of:
- GCI_Undefined: the default, nothing is known.
- GCI_GrayIndex: this is an independent gray-scale image
- GCI_PaletteIndex: this raster acts as an index into a color table
- GCI_RedBand: this raster is the red portion of an RGB or RGBA image
- GCI_GreenBand: this raster is the green portion of an RGB or RGBA image
- GCI_BlueBand: this raster is the blue portion of an RGB or RGBA image
- GCI_AlphaBand: this raster is the alpha portion of an RGBA image
- GCI_HueBand: this raster is the hue of an HLS image
- GCI_SaturationBand: this raster is the saturation of an HLS image
- GCI_LightnessBand: this raster is the hue of an HLS image
- GCI_CyanBand: this band is the cyan portion of a CMY or CMYK image
- GCI_MagentaBand: this band is the magenta portion of a CMY or CMYK image
- GCI_YellowBand: this band is the yellow portion of a CMY or CMYK image
- GCI_BlackBand: this band is the black portion of a CMYK image.
A color table, described in more detail later.
Knowledge of reduced resolution overviews (pyramids) if available.
其实在真正使用中,比较重要的无非是数据的nodata、xSize、ySize等等,投影等信息由Dataset获取。用于应付一般情况下的简单计算问题不大。
下一篇将详细解释一个常规的数据读取和处理的流程。
转载于:https://www.cnblogs.com/DannielZhang/p/5183761.html
【GDAL】聊聊GDAL的数据模型(二)——Band对象相关推荐
- GDAL源码剖析(二)之编译说明
一.简单的编译 1.使用VisualStudio IDE编译 首先进入GDAL的源代码目录,可以看到有几个sln为后缀的文件名,比如makegdal10.sln,makegdal80.sln,make ...
- 【GDAL】GDAL栅格数据结构学习笔记(一): 关于Metadata
在维护一段代码时看到前任程序员写的获取栅格数据的CellSize的功能,竟然在知道GDAL的情况下去调用AE的接口来解算,觉得费解. 原来的思路是使用AE的Raster对象读取出Raster的文件大小 ...
- 聊聊高并发(二十九)解析java.util.concurrent各个组件(十一) 再看看ReentrantReadWriteLock可重入读-写锁
上一篇聊聊高并发(二十八)解析java.util.concurrent各个组件(十) 理解ReentrantReadWriteLock可重入读-写锁 讲了可重入读写锁的基本情况和主要的方法,显示了如何 ...
- 聊聊高并发(二十五)解析java.util.concurrent各个组件(七) 理解Semaphore
前几篇分析了一下AQS的原理和实现,这篇拿Semaphore信号量做例子看看AQS实际是如何使用的. Semaphore表示了一种可以同时有多个线程进入临界区的同步器,它维护了一个状态表示可用的票据, ...
- 聊聊高并发(二十二)解析java.util.concurrent各个组件(四) 深入理解AQS(二)
上一篇介绍了AQS的基本设计思路以及两个内部类Node和ConditionObject的实现 聊聊高并发(二十一)解析java.util.concurrent各个组件(三) 深入理解AQS(一) 这篇 ...
- 聊聊高并发(二十九)解析java.util.concurrent各个组件(十一) 再看看ReentrantReadWriteLock可重入读-写锁...
上一篇聊聊高并发(二十八)解析java.util.concurrent各个组件(十) 理解ReentrantReadWriteLock可重入读-写锁 讲了可重入读写锁的基本情况和基本的方法,显示了怎样 ...
- 容易忽视但是功能灰常强大的Java API(二. 读写对象)
二. 读写对象 有时候你会遇到这样的情况:从数据集合中读取数据,解析数据,然后封装成对象,再把对象放到一个集合中,对集合对象进行操作,程序结束.第二次需要运行程序时,又按如上的操作流程做一遍.第三次, ...
- mac画图工具 OmniGraffle (二)对象的控制
非常不错的mac绘图教程,尊重原作者 原文地址:http://www.jianshu.com/p/bef7f6272c10 OmniGraffle (二)对象的控制 OmniGraffle 里的对象可 ...
- Python遥感图像处理应用篇(十四):GDAL 读取多光谱数据为二维数组并存入csv文件
1.使用数据 之前写过一遍文章是采用Arcgis读取多光谱数据为csv文件的,相对来说有一些麻烦,本文有个更简单一点的方法,使用python直接读取. 本文使用Landsat05数据,采用GEE下载的 ...
最新文章
- HYSBZ 1503 郁闷的出纳员 伸展树
- List接口实现类-ArrayList、Vector、LinkedList集合深入学习以及源代码解析
- HttpHandler(ashx)中获取Session状态
- 命令模式的两种不同实现
- python数据分析师书籍_如何自学成为数据分析师
- Transformer-XL语言模型:超长上下文依赖
- java删除表操作,JDBC删除表实例
- angular图片裁剪
- 能力素质有所欠缺_任职资格体系之七:员工能力评价模型
- 聚石塔,御城河接入,御河城安全整改demo
- PTA-数据库作业题(二)
- 杭电和深大计算机专业哪个好,杭州电子科技大学 还是 深圳大学?
- 什么是计算机网络 它有哪些主要功能,什么是计算机网络及主要功能有哪些?...
- 送外卖优先级_如何在恶劣天气让外卖小哥优先送您的订单?
- python实现自动化查谁没交作业
- Python华氏度和摄氏度之间的转换
- Mstar的Monitor方案笔记(六)——OSD添加新的主菜单
- 幽默笑话,哥们误会了,木子家原创
- 工作几年了,还没成为“算法人上人”?
- freeRTOS学习 — 消息邮箱
热门文章
- 牛津书虫系列双语读物
- 用java解决国王的金币问题_国王赏赐金币问题(减治法)
- python编程300例_经典编程100例——python版(例75)
- java split 逗号_java截取之空字符丢失
- 使用dumpsys检测Activity任务栈
- 自定义YUM软件仓库----FTP网络YUM源-----网络YUM源的配置
- 百度富文本编辑jsp上传_百度富文本编辑器教程,从入门到放弃
- python如何写日志_【Python】教你如何在python中添加日志
- 使用ansible来调度cron作业
- 我的爱好html子页模板,我的爱好