geotiffinfo
Information about GeoTIFF file
Description
Examples
Return Information about GeoTIFF File
Return information about a GeoTIFF file as a structure by using the geotiffinfo
function.
info = geotiffinfo('boston.tif')
info = struct with fields:
Filename: '/tmp/Bdoc24b_2725827_1251947/tpf9291afa/map-ex98657947/boston.tif'
FileModDate: '13-May-2011 22:28:45'
FileSize: 38729900
Format: 'tif'
FormatVersion: []
Height: 2881
Width: 4481
BitDepth: 8
ColorType: 'truecolor'
ModelType: 'ModelTypeProjected'
PCS: 'NAD83 / Massachusetts Mainland'
Projection: 'SPCS83 Massachusetts Mainland zone (meter)'
MapSys: 'STATE_PLANE_83'
Zone: 2001
CTProjection: 'CT_LambertConfConic_2SP'
ProjParm: [7x1 double]
ProjParmId: {7x1 cell}
GCS: 'NAD83'
Datum: 'North American Datum 1983'
Ellipsoid: 'GRS 1980'
SemiMajor: 6378137
SemiMinor: 6.3568e+06
PM: 'Greenwich'
PMLongToGreenwich: 0
UOMLength: 'US survey foot'
UOMLengthInMeters: 0.3048
UOMAngle: 'degree'
UOMAngleInDegrees: 1
TiePoints: [1x1 struct]
PixelScale: [3x1 double]
SpatialRef: [1x1 map.rasterref.MapCellsReference]
RefMatrix: [3x2 double]
BoundingBox: [2x2 double]
CornerCoords: [1x1 struct]
GeoTIFFCodes: [1x1 struct]
GeoTIFFTags: [1x1 struct]
ImageDescription: '"GeoEye"'
Find Coordinate Reference System for GeoTIFF File
Find the projected coordinate reference system (CRS) for the boston.tif
file.
Read information about the file as a structure array. Then, query the ProjectedCRS
property of the raster reference object within the SpatialRef
field of the structure array.
info = geotiffinfo("boston.tif");
crs = info.SpatialRef.ProjectedCRS
crs = projcrs with properties: Name: "NAD83 / Massachusetts Mainland" GeographicCRS: [1x1 geocrs] ProjectionMethod: "Lambert Conic Conformal (2SP)" LengthUnit: "U.S. survey foot" ProjectionParameters: [1x1 map.crs.ProjectionParameters]
If your file is referenced to a geographic CRS, then query the GeographicCRS
property instead of the ProjectedCRS
property.
Input Arguments
filename
— Name of GeoTIFF file
character vector
Name of the GeoTIFF file, specified as a character vector. Include the
folder name in filename
or place the file in the current
folder or in a folder on the MATLAB® path. If the named file includes the extension
.TIF
or .TIFF
(either upper- or
lowercase), you can omit the extension from
filename
.
If the named file contains multiple GeoTIFF images,
info
is a structure array with one element for each
image in the file. For example, info(3)
would contain
information about the third image in the file. If multiple images exist in
the file, it is assumed that each image has the same cartographic
information and image width and height.
url
— Internet URL
character vector
Internet URL, specified as a character vector. The URL must include the protocol type (e.g., "http://").
Output Arguments
info
— Image properties and cartographic information about a GeoTIFF file
structure
Image properties and cartographic information about a GeoTIFF file, returned as a structure containing the following fields.
Field | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Filename |
Name of the file or URL | ||||||||||||||||
FileModDate |
Modification date of the file | ||||||||||||||||
FileSize |
Integer indicating the size of the file in bytes. | ||||||||||||||||
Format |
File format (always | ||||||||||||||||
FormatVersion |
File format version | ||||||||||||||||
Height |
Integer indicating the height of the image in pixels | ||||||||||||||||
Width |
Integer indicating the width of the image in pixels | ||||||||||||||||
BitDepth |
Integer indicating the number of bits per pixel | ||||||||||||||||
ColorType |
Type of image: | ||||||||||||||||
ModelType |
Type of coordinate system used to georeference the
image: | ||||||||||||||||
PCS |
Projected coordinate system | ||||||||||||||||
Projection |
EPSG identifier for the underlying projection method | ||||||||||||||||
MapSys |
Map system, if applicable:
| ||||||||||||||||
Zone |
| ||||||||||||||||
CTProjection |
GeoTIFF identifier for the underlying projection method | ||||||||||||||||
ProjParm |
N-by-1 | ||||||||||||||||
ProjParmId |
N-by-1 cell array listing the projection parameter
identifier for each corresponding numerical element of
| ||||||||||||||||
GCS |
Geographic coordinate system | ||||||||||||||||
Datum |
Projection datum type, such as | ||||||||||||||||
Ellipsoid | Name of the ellipsoid, returned as a character vector. | ||||||||||||||||
SemiMajor |
| ||||||||||||||||
SemiMinor |
| ||||||||||||||||
PM |
Prime meridian location, for example,
| ||||||||||||||||
PmLongToGreenwich |
| ||||||||||||||||
UOMLength |
Units of length used in the projected coordinate system | ||||||||||||||||
UOMLengthInMeters |
| ||||||||||||||||
UOMAngle |
Angular units used for geographic coordinates | ||||||||||||||||
UOMAngleInDegrees |
| ||||||||||||||||
TiePoints |
Structure containing the image tiepoints. The structure contains these fields:
| ||||||||||||||||
PixelScale |
3-by-1 | ||||||||||||||||
SpatialRef | Value depends on the value of the
If the spatial referencing is ambiguously
defined by the GeoTIFF file, then
| ||||||||||||||||
RefMatrix |
3-by-2 | ||||||||||||||||
BoundingBox |
2-by-2 | ||||||||||||||||
CornerCoords |
Structure with six fields that contains coordinates of
the outer corners of the GeoTIFF image. Each field is a
1-by-4
| ||||||||||||||||
GeoTIFFCodes |
Structure containing raw numeric values for those
GeoTIFF fields that are encoded numerically in the file.
These raw values, converted to a character vectors
elsewhere in the
Each is scalar, except for
| ||||||||||||||||
GeoTIFFTags | Structure containing field names that match the GeoTIFF tags in the file. At least one GeoTIFF tag must be present in the file or an error is issued. The following fields may be included:
The The | ||||||||||||||||
ImageDescription |
Description of the image. If no description is included in the file, the field is omitted. |
Version History
Introduced before R2006aR2022a: Read coordinate reference system for GeoTIFF files
The geotiffinfo
function reads the projected or geographic
coordinate reference system (CRS) for GeoTIFF files as a projcrs
or
geocrs
object, respectively.
To find the CRS, get information about the GeoTIFF file using the
geotiffinfo
function, returned as a structure array. Then,
query the CRS property of the raster reference object within the
SpatialRef
field of the structure array. If the file is
referenced to a projected CRS, query the ProjectedCRS
property.
If the file is referenced to a geographic CRS, query the
GeographicCRS
property. This code snippet shows how to get
the CRS of the boston.tif
file, which is referenced to a
projected
CRS.
info = geotiffinfo("boston.tif");
crs = info.SpatialRef.ProjectedCRS
crs = projcrs with properties: Name: "NAD83 / Massachusetts Mainland" GeographicCRS: [1×1 geocrs] ProjectionMethod: "Lambert Conic Conformal (2SP)" LengthUnit: "U.S. survey foot" ProjectionParameters: [1×1 map.crs.ProjectionParameters]
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 (한국어)