主要内容

本页采用了机器翻译。点击此处可查看英文原文。

georefcells

将参考栅格单元转换为地理坐标

说明

R = georefcells() 返回一个默认参考对象,用于表示地理坐标系下的规则栅格单元。

R = georefcells(latlim,lonlim,rasterSize) 构建一个参考对象,用于表示覆盖指定纬度和经度范围的栅格单元,其行数和列数由 rasterSize 参数指定。

示例

R = georefcells(latlim,lonlim,latcellextent,loncellextent) 允许精确设置地理单元范围。如有必要,georefcells 会略微调整地理边界,以确保每个维度中的单元数量为整数。

示例

R = georefcells(latlim,lonlim,___,Name,Value) 允许通过名称-值对指定列和行的方向。

示例

示例

全部折叠

构建一个全局栅格的参考对象,该栅格由 180×360 个 1 度网格单元组成,行从西经 180 度开始,首个单元位于西北角。

latlim = [-90 90];
lonlim = [-180 180];
rasterSize = [180 360];

通过指定栅格大小创建栅格参考对象。

R = georefcells(latlim,lonlim,rasterSize,'ColumnsStartFrom','north')
R = 
  GeographicCellsReference with properties:

             LatitudeLimits: [-90 90]
            LongitudeLimits: [-180 180]
                 RasterSize: [180 360]
       RasterInterpretation: 'cells'
           ColumnsStartFrom: 'north'
              RowsStartFrom: 'west'
       CellExtentInLatitude: 1
      CellExtentInLongitude: 1
     RasterExtentInLatitude: 180
    RasterExtentInLongitude: 360
           XIntrinsicLimits: [0.5 360.5]
           YIntrinsicLimits: [0.5 180.5]
       CoordinateSystemType: 'geographic'
              GeographicCRS: []
                  AngleUnit: 'degree'


通过指定单元范围获得相同结果。

extent = 1;

R = georefcells(latlim,lonlim,extent,extent,'ColumnsStartFrom','north')
R = 
  GeographicCellsReference with properties:

             LatitudeLimits: [-90 90]
            LongitudeLimits: [-180 180]
                 RasterSize: [180 360]
       RasterInterpretation: 'cells'
           ColumnsStartFrom: 'north'
              RowsStartFrom: 'west'
       CellExtentInLatitude: 1
      CellExtentInLongitude: 1
     RasterExtentInLatitude: 180
    RasterExtentInLongitude: 360
           XIntrinsicLimits: [0.5 360.5]
           YIntrinsicLimits: [0.5 180.5]
       CoordinateSystemType: 'geographic'
              GeographicCRS: []
                  AngleUnit: 'degree'


输入参数

全部折叠

纬度范围(以度为单位),指定为 1×2 数值向量。生成的栅格图像的行数由 rasterSize 参数指定。

示例: latlim = [-90 90];

经度范围(以度为单位),指定为 1×2 数值向量。生成的栅格图像的列数由 rasterSize 参数指定。

示例: lonlim = [-180 180];

栅格大小,指定为 1×2 的数值向量。

示例: rasterSize = [180 360];

单元高度,指定为数值标量。latcellextent 的值决定了 RCellExtentInLatitude 属性。

示例: latcellextent = 1.5

单元宽度,指定为数值标量。loncellextent 的值决定了 RCellExtentInLongitude 属性。

示例: latcellextent = 1.5

名称-值参数

全部折叠

将可选参量对组指定为 Name1=Value1,...,NameN=ValueN,其中 Name 是参量名称,Value 是对应的值。名称-值参量必须出现在其他参量之后,但对各个参量对组的顺序没有要求。

如果使用的是 R2021a 之前的版本,请使用逗号分隔每个名称和值,并用引号将 Name 引起来。

示例: R = georefcells(latlim,lonlim,rasterSize,'ColumnsStartFrom','north')

列索引起始边界,指定为 'north''south'

示例: R = georefcells(latlim,lonlim,rasterSize,'ColumnsStartFrom','north')

数据类型: char | string

列索引起始边界,指定为 'east''west'

示例: R = georefcells(latlim,lonlim,rasterSize,'RowsStartFrom','east')

数据类型: char | string

输出参量

全部折叠

参考栅格单元至地理坐标的对象,以 GeographicCellsReference 栅格参考对象形式返回。

提示

  • 要从世界文件矩阵构建地理栅格参考对象,请使用 georasterref 函数。

版本历史记录

在 R2015b 中推出