Main Content

RasterInfo

Information about geospatial raster data file

Since R2020a

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

expand all

This property is read-only.

Path to data file and any supporting files, returned as a string array.

Data Types: string

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

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

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

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

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

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

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

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

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

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

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 a GeographicCellsReference object or GeographicPostingsReference object.

  • If the raster data is referenced to a projected coordinate system, then RasterReference is a MapCellsReference object or MapPostingsReference 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'.

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 a geocrs object.

  • If the raster data is referenced to a projected coordinate system, then CoordinateReferenceSystem is a projcrs object.

  • If the file does not contain valid coordinate reference system information, then CoordinateReferenceSystem is empty.

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 of Metadata contains a string. When a GeoTIFF file contains RPC coefficient tags, Metadata includes an RPCCoefficientTag field that contains an RPCCoefficientTag object.

  • For GRIB files, Metadata is a table with NumBands 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

collapse all

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