RasterInfo
Description
RasterInfo
objects contain information about geographic or
projected raster data files, such as their file format, their native data type, and how they
represent missing data.
Creation
Create a RasterInfo
object using georasterinfo
.
Properties
Filename
— Path to data file
string
array
This property is read-only.
Path to data file and any supporting files, returned as a string
array.
Data Types: string
FileModifiedDate
— Modification date of files
datetime
array
This property is read-only.
Modification date of the data file and any supporting files, returned as a
datetime
array. The order of modification dates in
FileModifiedDate
corresponds to the order of files in
Filename
.
Data Types: datetime
FileSize
— File size
array
This property is read-only.
File size of the data file and any supporting files, returned as an array. The order
of file sizes in FileSize
corresponds to the order of files in
Filename
.
Data Types: double
FileFormat
— File format name
string
scalar
This property is read-only.
File format name, returned as a string
scalar. For a list of
supported file formats, see georasterinfo
.
Data Types: string
RasterSize
— Dimensions of raster data
two-element vector
This property is read-only.
Dimensions of the raster data embedded in the file, returned as a two-element
vector, [m n]
, where m
is the number of rows and
n
is the number of columns.
Data Types: double
NumBands
— Number of bands
positive integer
This property is read-only.
Number of bands, returned as a positive integer.
When you read raster data using the readgeoraster
function, the array it returns is of size
M-by-N-by-P, where
P is the value of NumBands
.
Data Types: double
NativeFormat
— Data type embedded in file
string
scalar
This property is read-only.
Data type of the data embedded in the file, returned as a string
scalar. To read data using a different data type, call readgeoraster
and specify the 'OutputType'
name-value pair.
Data Types: string
MissingDataIndicator
— Value indicating missing data
integer
This property is read-only.
Value indicating missing data, returned as an integer. You can replace missing data
with NaN
values using the standardizeMissing
function.
[A,R] = readgeoraster('MtWashington-ft.grd'); info = georasterinfo('MtWashington-ft.grd'); m = info.MissingDataIndicator; A = standardizeMissing(A,m);
Data Types: double
Categories
— Category names
string
array
This property is read-only.
Category names, returned as a string
array.
The value of Categories
may be empty, even when the data is
grouped into categories.
Data Types: string
ColorType
— Color type of image
'indexed'
| 'grayscale'
| 'truecolor'
| 'CMYK'
| 'HSL'
| 'unknown'
This property is read-only.
Color type of image, returned as one of these values:
'indexed'
– Indexed image.'grayscale'
– Grayscale intensity image.'truecolor'
– True color image using RGB color space.'CMYK'
– Image using CMYK color space.'HSL'
– Image using HSL color space.'unknown'
– Unknown color type, or raster data does not represent an image.
Data Types: string
Colormap
— Colormap
n-by-3 matrix
This property is read-only.
Colormap associated with an indexed image, returned as a n-by-3
matrix with values in the range [0,1]. Each row of Colormap
is a
three-element RGB triplet that specifies the red, green, and blue components of a single
color of the colormap. The value of Colormap
is empty unless the
value of ColorType
is 'indexed'
.
Data Types: double
RasterReference
— Spatial reference
GeographicCellsReference
object | GeographicPostingsReference
object | MapCellsReference
object | MapPostingsReference
object
This property is read-only.
Spatial reference for the raster data, returned as a GeographicCellsReference
object, GeographicPostingsReference
object, MapCellsReference
object, or MapPostingsReference
object. The value of
RasterReference
depends on the raster data contained in the file:
If the raster data is referenced to a geographic coordinate system, then
RasterReference
is aGeographicCellsReference
object orGeographicPostingsReference
object.If the raster data is referenced to a projected coordinate system, then
RasterReference
is aMapCellsReference
object orMapPostingsReference
object.
If the file does not contain enough information to determine whether the data is
projected or geographic, then RasterReference
is a
MapCellsReference
or MapPostingsReference
object. If
a file contains no valid spatial reference information, then
RasterReference
is empty.
Regardless of the file format, the ColumnsStartFrom
property of
the reference object returned by RasterReference
has a value of
'north'
.
CoordinateReferenceSystem
— Coordinate reference system
[]
(default) | projcrs
object | geocrs
object
This property is read-only.
Coordinate reference system (CRS), returned as a geocrs
or
projcrs
object.
The value of CoordinateReferenceSystem
depends on the raster data
contained in the file:
If the raster data is referenced to a geographic coordinate system, then
CoordinateReferenceSystem
is ageocrs
object.If the raster data is referenced to a projected coordinate system, then
CoordinateReferenceSystem
is aprojcrs
object.If the file does not contain valid coordinate reference system information, then
CoordinateReferenceSystem
is empty.
Metadata
— Metadata
structure array | table
This property is read-only.
Metadata, returned as a structure array or a table. Metadata indicates additional information that is specific to the data file. For example, DTED files can contain metadata such as the datum, coordinates of the data origin, and absolute accuracy.
For most file formats,
Metadata
is a structure array. The data in the file determines the field names and values of the structure. In most cases, each field ofMetadata
contains a string. When a GeoTIFF file contains RPC coefficient tags,Metadata
includes anRPCCoefficientTag
field that contains anRPCCoefficientTag
object.For GRIB files,
Metadata
is a table withNumBands
rows. Each row of the table corresponds to a band of data in the file. The table variables contain information such as descriptions, reference times, and forecast durations. Each table variable stores the information using strings, datetimes, or durations.
This property applies to only those file formats that can have metadata.
Examples
Get GeoTIFF Image Information
Get information about a GeoTIFF image by creating a RasterInfo
object. Find the native data type embedded in the file by accessing the NativeFormat
property of the RasterInfo
object.
info = georasterinfo("boston.tif");
info.NativeFormat
ans = "uint8"
The data used in this example includes material copyrighted by GeoEye, all rights reserved.
Version History
Introduced in R2020a
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 (한국어)