Main Content

geotiffinfo

Information about GeoTIFF file

Description

example

info = geotiffinfo(filename) returns a structure whose fields contain image properties and cartographic information about a GeoTIFF file.

info = geotiffinfo(url) reads the GeoTIFF image from a URL.

Examples

collapse all

Return information about a GeoTIFF file as a structure by using the geotiffinfo function.

info = geotiffinfo('boston.tif')
info = struct with fields:
             Filename: '/tmp/Bdoc23b_2361005_1216019/tpdc57457f/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 (meters)'
               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 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

collapse all

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.

Internet URL, specified as a character vector. The URL must include the protocol type (e.g., "http://").

Output Arguments

collapse all

Image properties and cartographic information about a GeoTIFF file, returned as a structure containing the following fields.

FieldDescription
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 'tiff')

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: 'truecolor' for a true-color (RGB) image, 'grayscale' for a grayscale image, or 'indexed' for an indexed image.

ModelType

Type of coordinate system used to georeference the image: 'ModelTypeProjected', 'ModelTypeGeographic', 'ModelTypeGeocentric', or ''.

PCS

Projected coordinate system

Projection

EPSG identifier for the underlying projection method

MapSys

Map system, if applicable: 'STATE_PLANE_27', 'STATE_PLANE_83', 'UTM_NORTH', 'UTM_SOUTH', or ''

Zone

double indicating the UTM or State Plane Zone number, empty ([]) if not applicable or unknown

CTProjection

GeoTIFF identifier for the underlying projection method

ProjParm

N-by-1 double vector containing projection parameter values. The identity of each element is specified by the corresponding element of ProjParmId. Lengths are in meters, angles in decimal degrees.

ProjParmId

N-by-1 cell array listing the projection parameter identifier for each corresponding numerical element of ProjParm:

  • 'ProjNatOriginLatGeoKey'

  • 'ProjNatOriginLongGeoKey'

  • 'ProjFalseEastingGeoKey'

  • 'ProjFalseNorthingGeoKey'

  • 'ProjFalseOriginLatGeoKey'

  • 'ProjFalseOriginLongGeoKey'

  • 'ProjCenterLatGeoKey'

  • 'ProjCenterLongGeoKey'

  • 'ProjAzimuthAngleGeoKey'

  • 'ProjRectifiedGridAngleGeoKey'

  • 'ProjScaleAtNatOriginGeoKey'

  • 'ProjStdParallel1GeoKey'

  • 'ProjStdParallel2GeoKey'

GCS

Geographic coordinate system

Datum

Projection datum type, such as 'North American Datum 1927' or 'North American Datum 1983'

Ellipsoid

Name of the ellipsoid, returned as a character vector.

SemiMajor

double indicating the length of the semimajor axis of the ellipsoid, in meters

SemiMinor

double indicating the length of the semiminor axis of the ellipsoid, in meters

PM

Prime meridian location, for example, 'Greenwich' or 'Paris'

PmLongToGreenwich

double indicating the decimal degrees of longitude between this prime meridian and Greenwich. Prime meridians to the west of Greenwich are negative.

UOMLength

Units of length used in the projected coordinate system

UOMLengthInMeters

double defining the UOMLength unit in meters.

UOMAngle

Angular units used for geographic coordinates

UOMAngleInDegrees

double defining the UOMAngle unit in degrees.

TiePoints

Structure containing the image tiepoints. The structure contains these fields:

Field NameDescription
ImagePoints

Structure containing row and column coordinates of each image tiepoint. The ImagePoints structure contains these fields:

  • Rowdouble array of size 1-by-N

  • Coldouble array of size 1-by-N

WorldPoints

Structure containing the x and y world coordinates of the tiepoints. The WorldPoints structure contains these fields:

  • Xdouble array of size 1-by-N

  • Ydouble array of size 1-by-N

PixelScale

3-by-1 double array that specifies the X, Y, Z pixel scale values.

SpatialRef

Value depends on the value of the ModelType field:

If the spatial referencing is ambiguously defined by the GeoTIFF file, then SpatialRef is empty ([]).

RefMatrix

3-by-2 double referencing matrix that must be unambiguously defined by the GeoTIFF file. Otherwise it is empty ([]).

BoundingBox

2-by-2 double array that specifies the minimum (row 1) and maximum (row 2) values for each dimension of the image data in the GeoTIFF file.

CornerCoords

Structure with six fields that contains coordinates of the outer corners of the GeoTIFF image. Each field is a 1-by-4 double array, or empty ([]) if unknown. The arrays contain the coordinates of the outer corners of the corner pixels, starting from the (1,1) corner and proceeding clockwise:

FieldDescription
XEasting coordinates in the projected coordinate system. X equals Lon (below) if ModelType is 'ModelTypeGeographic'
YNorthing coordinates in the projected coordinate system. Y equals Lat (below) if ModelType is 'ModelTypeGeographic'
RowRow coordinates of the corner.
ColColumn coordinates of the corner.
LatLatitudes of the corner.
LonLongitudes of the corner.

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 info structure, are provided here for reference.

  • Model

  • PCS

  • GCS

  • UOMLength

  • UOMAngle

  • Datum

  • PM

  • Ellipsoid

  • ProjCode

  • Projection

  • CTProjection

  • ProjParmId

  • MapSys

Each is scalar, except for ProjParmId, which is a column vector.

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:

FieldValue
ModelPixelScaleTag1-by-3 double
ModelTiepointTag1-by-6 double
ModelTransformationTag1-by-16 double
GeoKeyDirectoryTagscalar structure
GeoAsciiParamsTagcharacter vector
GeoDoubleParamsTag1-by-N double
RPCCoefficientTagscalar RPCCoefficientTag

The GeoKeyDirectoryTag contains field names that match the names of the "GeoKeys". For more information about the "GeoKeys" refer to the GeoTIFF specification.

The RPCCoefficientTag contains properties with names corresponding to the tag elements listed in the RPCs in GeoTIFF technical note at: http://geotiff.maptools.org/rpc_prop.html

ImageDescription

Description of the image. If no description is included in the file, the field is omitted.

Version History

Introduced before R2006a

expand all