georasterinfo
Description
info = georasterinfo(
creates a
filename
)RasterInfo
object
for a geographic or projected raster data file with a format such as GeoTIFF, Esri Binary
Grid, GRIB, or DTED. For a full list of supported formats, see Supported Formats.
Examples
Get Information About Geospatial Raster Data
Get information about a geospatial raster data file by creating a RasterInfo
object.
info = georasterinfo('boston.tif');
Access individual properties of the RasterInfo
object using dot notation.
info.NativeFormat
ans = "uint8"
Get DTED Metadata
Get information about a DTED file by creating a RasterInfo
object. Get metadata specific to DTED files by accessing the Metadata
property of the RasterInfo
object.
info = georasterinfo('n39_w106_3arc_v2.dt1');
md = info.Metadata
md = struct with fields:
AREA_OR_POINT: "Point"
DTED_CompilationDate: "0002"
DTED_DataEdition: "02"
DTED_DigitizingSystem: "SRTM "
DTED_HorizontalAccuracy: "0013"
DTED_HorizontalDatum: "WGS84"
DTED_MaintenanceDate: "0000"
DTED_MaintenanceDescription: "0000"
DTED_MatchMergeDate: "0000"
DTED_MatchMergeVersion: "A"
DTED_NimaDesignator: "DTED1"
DTED_OriginLatitude: "0390000N"
DTED_OriginLongitude: "1060000W"
DTED_PartialCellIndicator: "00"
DTED_Producer: "USCNIMA "
DTED_RelHorizontalAccuracy: "NA "
DTED_RelVerticalAccuracy: "0006"
DTED_SecurityCode_DSI: "U"
DTED_SecurityCode_UHL: "U "
DTED_UniqueRef_DSI: "G19 107 "
DTED_UniqueRef_UHL: "G19 107 "
DTED_VerticalAccuracy_ACC: "0006"
DTED_VerticalAccuracy_UHL: "0006"
DTED_VerticalDatum: "E96"
Find the coordinates of the lower-left corner of the data by accessing the DTED_OriginLatitude
and DTED_OriginLongitude
fields of the metadata structure. The coordinates are stored as strings. Convert the strings to angles.
latS = md.DTED_OriginLatitude; lonS = md.DTED_OriginLongitude; latA = str2angle(latS)
latA = 39
lonA = str2angle(lonS)
lonA = -106
The DTED file used in this example is courtesy of the US Geological Survey.
Get GRIB Metadata
Since R2023b
Get information about a GRIB file [1][2] by creating a RasterInfo
object. Get the metadata for the GRIB file by accessing the Metadata
property of the RasterInfo
object.
info = georasterinfo("seaice.grib");
md = info.Metadata
md=7×8 table
Description Comment Unit Element ShortName ReferenceTime ValidTime ForecastSeconds
____________________________________ _________________________ _____ _______ _________ ____________________ ____________________ _______________
"0[-] SFC (Ground or water surface)" "Sea ice cover (0-1) [-]" "[-]" "CI" "0-SFC" 01-Sep-2010 12:00:00 01-Sep-2010 12:00:00 0 sec
"0[-] SFC (Ground or water surface)" "Sea ice cover (0-1) [-]" "[-]" "CI" "0-SFC" 01-Sep-2012 12:00:00 01-Sep-2012 12:00:00 0 sec
"0[-] SFC (Ground or water surface)" "Sea ice cover (0-1) [-]" "[-]" "CI" "0-SFC" 01-Sep-2014 12:00:00 01-Sep-2014 12:00:00 0 sec
"0[-] SFC (Ground or water surface)" "Sea ice cover (0-1) [-]" "[-]" "CI" "0-SFC" 01-Sep-2016 12:00:00 01-Sep-2016 12:00:00 0 sec
"0[-] SFC (Ground or water surface)" "Sea ice cover (0-1) [-]" "[-]" "CI" "0-SFC" 01-Sep-2018 12:00:00 01-Sep-2018 12:00:00 0 sec
"0[-] SFC (Ground or water surface)" "Sea ice cover (0-1) [-]" "[-]" "CI" "0-SFC" 01-Sep-2020 12:00:00 01-Sep-2020 12:00:00 0 sec
"0[-] SFC (Ground or water surface)" "Sea ice cover (0-1) [-]" "[-]" "CI" "0-SFC" 01-Sep-2022 12:00:00 01-Sep-2022 12:00:00 0 sec
RasterInfo
objects store GRIB metadata using a table, where each row of the table corresponds to a band of data in the file. View the comment, reference time, and forecast duration for the third data band.
md3 = md(3,:); md3.Comment
ans = "Sea ice cover (0-1) [-]"
md3.ReferenceTime
ans = datetime
01-Sep-2014 12:00:00
md3.ForecastSeconds
ans = duration
0 sec
[1] Hersbach, H., B. Bell, P. Berrisford, G. Biavati, A. Horányi, J. Muñoz Sabater, J. Nicolas, et al. "ERA5 Hourly Data on Single Levels from 1940 to Present." Copernicus Climate Change Service (C3S) Climate Data Store (CDS), 2023. Accessed May 22, 2023. https://doi.org/10.24381/cds.adbb2d47.
[2] Neither the European Commission nor ECMWF is responsible for any use that may be made of the Copernicus information or data it contains.
Input Arguments
filename
— Name of raster data file
character vector | string scalar
Name of the raster data file, specified as a character vector or string scalar. The
form of filename
depends on the location of your file.
If the file is in your current folder or in a folder on the MATLAB® path, then specify the name of the file, such as
'myFile.dem'
.If the file is not in the current folder or in a folder on the MATLAB path, then specify the full or relative path name, such as
'C:\myfolder\myFile.tif'
or'dataDir\myFile.dat'
.
For a list of supported file formats, see Supported Formats.
Data Types: char
| string
More About
Supported Formats
The readgeoraster
and
georasterinfo
functions support these file formats.
GeoTIFF (
.tif
or.tiff
)Esri Binary Grid (
.adf
)Esri ASCII Grid (
.asc
or.grd
)Esri GridFloat (
.flt
)GRIB (
.grb
,.grib
,.grib2
) (since R2023b)DTED (
.dt0
,.dt1
, or.dt2
)SDTS (
.DDF
)USGS DEM (
.dem
)SRTM Height (
.hgt
)Vertical Mapper Numeric Grid (
.grd
)Vertical Mapper Classified Grid (
.grc
)ER Mapper ERS (
.ers
)ENVI (
.dat
)ERDAS IMAGINE (
.img
)Geospatially referenced JPEG 2000 (
.jp2
) (since R2023b)
The extension of a file does not always indicate its file format. If you do not know the format of your file, ask your data provider. In some cases, you can read files in supported formats when they have no extensions or have extensions other than the ones listed.
Some file formats consist of a data file and multiple supporting files. For example, Esri
GridFloat files may have supporting header files (.hdr
). When you read a
data file with supporting files using readgeoraster
or
georasterinfo
, specify the extension of the data file.
File formats may be referred to using different names. For example, the Esri GridFloat
format may also be referred to as Esri .hdr
Labelled or ITT ESRI
.hdr
RAW Raster. The Esri Binary Grid format may also be referred to
as ArcGrid Binary, Esri ArcGIS Binary Grid, or Esri ArcInfo Grid.
Version History
Introduced in R2020aR2024b: Get information about compressed GRIB files
The georasterinfo
function can get information from GRIB files that
use Consultative Committee for Space Data Systems (CCSDS) compression, as defined by CCSDS
recommended standard 121.0-B-3.
R2023b: Get information about data in GRIB files
The georasterinfo
function can get information about files in the
GRIB format (.grb
, .grib
,
.grib2
).
R2023b: Get information about geospatial data in JPEG 2000 files
The georasterinfo
function can get information about geospatial
data from files in the JPEG 2000 format (.jp2
).
R2021b: Get information about SRTM Height data
The georasterinfo
function can get information about SRTM Height
data files with extension .hgt
.
R2021a: Get information about data in Vertical Mapper Grid formats
The georasterinfo
function can get information about data in the
Vertical Mapper Numeric Grid and Vertical Mapper Classified Grid formats.
See Also
Functions
Objects
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 (한국어)