geotiffinfo
Information about GeoTIFF file
Description
Examples
Return information about a GeoTIFF file as a structure by using the geotiffinfo function.
info = geotiffinfo('boston.tif')info = struct with fields:
             Filename: '/tmp/Bdoc25b_3037623_1587783/tp23c147bc/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: [7×1 double]
           ProjParmId: {7×1 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: [1×1 struct]
           PixelScale: [3×1 double]
           SpatialRef: [1×1 map.rasterref.MapCellsReference]
            RefMatrix: [3×2 double]
          BoundingBox: [2×2 double]
         CornerCoords: [1×1 struct]
         GeoTIFFCodes: [1×1 struct]
          GeoTIFFTags: [1×1 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.ProjectedCRScrs = 
  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]
If your file is referenced to a geographic CRS, then query the GeographicCRS property instead of the ProjectedCRS property.
Input Arguments
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
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 R2006aThe 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.ProjectedCRScrs = 
  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.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- 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)