sizesMatch
Determine if geographic or map raster object and image or raster are size-compatible
Syntax
Description
Examples
Check If Image and Geographic Raster Are Size-Compatible
Create a GeographicPostingsReference
raster reference object.
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'
Create an arbitrary image (raster) with dimensions 91-by-361. Confirm that the image size is compatible with the geographic raster reference object.
A = ones(91,361); tf_A = sizesMatch(R,A)
tf_A = logical
1
Create an image of a different size. Confirm that this new image is not size-compatible with the geographic raster reference object.
B = ones(90,361); tf_B = sizesMatch(R,B)
tf_B = logical
0
Input Arguments
R
— Geographic or map raster
GeographicCellsReference
object | GeographicPostingsReference
object | MapCellsReference
object | MapPostingsReference
object
Geographic or map raster, specified as a GeographicCellsReference
,
GeographicPostingsReference
,
MapCellsReference
, or MapPostingsReference
object.
A
— Image or raster
numeric array or raster object
Image or raster, specified as a numeric array or raster object.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| geographic raster object
| map raster object
Output Arguments
tf
— Flag indicating geographic or map raster is size-compatible with image or raster
logical scalar
Flag indicating geographic or map raster is size-compatible with image or
raster, returned as a logical scalar. tf
is
True
when R.RasterSize
is equal to
[size(A,1) size(A,2)]
or
A.RasterSize
.
Data Types: logical
Version History
Introduced in R2013b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)