RasterInfo
Information about geospatial raster data file
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
This property is read-only.
Path to data file and any supporting files, represented as a
string array.
Data Types: string
This property is read-only.
Modification date of the data file and any supporting files, represented as a
datetime array. The order of modification dates in
FileModifiedDate corresponds to the order of files in
Filename.
Data Types: datetime
This property is read-only.
File size of the data file and any supporting files, represented as an array. The
order of file sizes in FileSize corresponds to the order of files
in Filename.
Data Types: double
This property is read-only.
File format name, represented as a string scalar. For a list of
supported file formats, see georasterinfo.
Data Types: string
This property is read-only.
Dimensions of the raster data embedded in the file, represented as a two-element
vector, [m n], where m is the number of rows and
n is the number of columns.
Data Types: double
This property is read-only.
Number of bands, represented 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
This property is read-only.
Data type of the data embedded in the file, represented as a
string scalar. To read data using a different data type, call
readgeoraster
and specify the OutputType name-value argument.
Data Types: string
This property is read-only.
Value indicating missing data, represented as an integer.
When the readgeoraster function returns data using the
single or double data type, the function
replaces values that match the missing data indicator with NaN
values. You can prevent readgeoraster from replacing missing data
by specifying the StandardizeMissing name-value argument as
false.
Before R2025a: You can replace missing data with
NaN values using the standardizeMissing
function.
[A,R] = readgeoraster(filename,OutputType="double");
info = georasterinfo(filename);
m = info.MissingDataIndicator;
A = standardizeMissing(A,m);Data Types: double
This property is read-only.
Category names, represented as a string array.
The value of Categories may be empty, even when the data is
grouped into categories.
Data Types: string
This property is read-only.
Color type of image, represented 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
This property is read-only.
Colormap associated with an indexed image, represented 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
This property is read-only.
Spatial reference for the raster data, represented 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
RasterReferenceis aGeographicCellsReferenceobject orGeographicPostingsReferenceobject.If the raster data is referenced to a projected coordinate system, then
RasterReferenceis aMapCellsReferenceobject orMapPostingsReferenceobject.
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".
This property is read-only.
Coordinate reference system (CRS), represented 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
CoordinateReferenceSystemis ageocrsobject.If the raster data is referenced to a projected coordinate system, then
CoordinateReferenceSystemis aprojcrsobject.If the file does not contain valid coordinate reference system information, then
CoordinateReferenceSystemis empty.
This property is read-only.
Metadata, represented 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,
Metadatais a structure array. The data in the file determines the field names and values of the structure. In most cases, each field ofMetadatacontains a string. When a GeoTIFF file contains RPC coefficient tags,Metadataincludes anRPCCoefficientTagfield that contains anRPCCoefficientTagobject.For GRIB files,
Metadatais a table withNumBandsrows. 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 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.NativeFormatans = "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)