主要内容

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

sizesMatch

确定地理对象或地图栅格对象与图像或栅格在尺寸上是否兼容

说明

tf = sizesMatch(R,A) 用于判断地理栅格或地图栅格 R 与图像或栅格 A 的尺寸是否兼容。

示例

示例

全部折叠

创建一个 GeographicPostingsReference 栅格参考对象。

latlim = [0 90];
lonlim = [-180 180];
rasterSize = [91 361];
R = georefpostings(latlim,lonlim,rasterSize,'ColumnsStartFrom','north')
R = 
  GeographicPostingsReference with properties:

              LatitudeLimits: [0 90]
             LongitudeLimits: [-180 180]
                  RasterSize: [91 361]
        RasterInterpretation: 'postings'
            ColumnsStartFrom: 'north'
               RowsStartFrom: 'west'
     SampleSpacingInLatitude: 1
    SampleSpacingInLongitude: 1
      RasterExtentInLatitude: 90
     RasterExtentInLongitude: 360
            XIntrinsicLimits: [1 361]
            YIntrinsicLimits: [1 91]
        CoordinateSystemType: 'geographic'
               GeographicCRS: []
                   AngleUnit: 'degree'


创建一张维度为 91×361 的任意图像(栅格图像)。请确认图像尺寸与地理栅格参考对象兼容。

A = ones(91,361);
tf_A = sizesMatch(R,A)
tf_A = logical
   1

创建一张不同尺寸的图像。确认此新影像与地理栅格参考对象的尺寸不兼容。

B = ones(90,361);
tf_B = sizesMatch(R,B)
tf_B = logical
   0

输入参数

全部折叠

图像或栅格,指定为数值数组或栅格对象。

数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | geographic raster object | map raster object

输出参量

全部折叠

指示地理或地图栅格与图像或栅格尺寸兼容的标志,以逻辑标量形式返回。当 R.RasterSize 等于 [size(A,1) size(A,2)]A.RasterSize 时,tf 等于 True

数据类型: logical

版本历史记录

在 R2013b 中推出