gdalinfo - Man Page
Lists various information about a GDAL supported raster dataset
Examples (TL;DR)
- List all supported raster formats:
gdalinfo --formats
- List information about a specific raster dataset:
gdalinfo path/to/input.tif
- List information about a specific raster dataset in JSON format:
gdalinfo -json path/to/input.tif
- Show histogram values of a specific raster dataset:
gdalinfo -hist path/to/input.tif
- List information about a Web Map Service (WMS):
gdalinfo WMS:https://services.meggsimum.de/geoserver/ows
- List information about a specific dataset of a Web Map Service (WMS):
gdalinfo WMS:https://services.meggsimum.de/geoserver/ows -sd 4
Synopsis
Usage: gdalinfo [--help] [--long-usage] [--help-general] [-json] [-mm] [[-stats]|[-approx_stats]] [-hist] [-nogcp] [-nomd] [-norat] [-noct] [-nofl] [-nonodata] [-nomask] [-checksum] [-listmdd] [-proj4] [-wkt_format <WKT1|WKT2|WKT2_2015|WKT2_2018|WKT2_2019>] [-sd <n>] [-oo <NAME>=<VALUE>]... [-if <format>]... [-mdd <domain>|all] <dataset_name>
Description
gdalinfo program lists various information about a GDAL supported raster dataset.
The following command line parameters can appear in any order
- --help
Show this help message and exit
- --help-general
Gives a brief usage message for the generic GDAL commandline options and exit.
- -json
Display the output in json format. Since GDAL 3.6, this includes key-value pairs useful for building a STAC item , including statistics and histograms if -stats or -hist flags are passed, respectively.
- -mm
Force computation of the actual min/max values for each band in the dataset.
- -stats
Read and display image statistics. Force computation if no statistics are stored in an image.
- -approx_stats
Read and display image statistics. Force computation if no statistics are stored in an image. However, they may be computed based on overviews or a subset of all tiles. Useful if you are in a hurry and don't need precise stats.
- -hist
Report histogram information for all bands.
- -nogcp
Suppress ground control points list printing. It may be useful for datasets with huge amount of GCPs, such as L1B AVHRR or HDF4 MODIS which contain thousands of them.
- -nomd
Suppress metadata printing. Some datasets may contain a lot of metadata strings.
- -norat
Suppress printing of raster attribute table.
- -noct
Suppress printing of color table.
- -nonodata
Added in version 3.10.
Suppress nodata printing. Implies -nomask.
Can be useful for example when querying a remove GRIB2 dataset that has an index .idx side-car file, together with -nomd
- -nomask
Added in version 3.10.
Suppress band mask printing. Is implied if -nonodata is specified.
- -checksum
Force computation of the checksum for each band in the dataset.
- -listmdd
List all metadata domains available for the dataset.
- -mdd <domain>|all
adds metadata using:
domain Report metadata for the specified domain.
all Report metadata for all domains.
- -nofl
Only display the first file of the file list.
- -wkt_format WKT1|WKT2|WKT2_2015|WKT2_2018|WKT2_2019
WKT format used to display the SRS. Currently the supported values are:
WKT1
WKT2 (latest WKT version, currently WKT2_2019)
WKT2_2015
WKT2_2018 (deprecated)
WKT2_2019
Added in version 3.0.0.
- -sd <n>
If the input dataset contains several subdatasets read and display a subdataset with specified n number (starting from 1). This is an alternative of giving the full subdataset name.
- -proj4
Report a PROJ.4 string corresponding to the file's coordinate system.
- -oo <NAME>=<VALUE>
Dataset open option (format specific).
- -if <format>
Format/driver name to be attempted to open the input file(s). It is generally not necessary to specify it, but it can be used to skip automatic driver detection, when it fails to select the appropriate driver. This option can be repeated several times to specify several candidate drivers. Note that it does not force those drivers to open the dataset. In particular, some drivers have requirements on file extensions.
Added in version 3.2.
The gdalinfo will report all of the following (if known):
- The format driver used to access the file.
- Raster size (in pixels and lines).
- The coordinate system for the file (in OGC WKT).
- The geotransform associated with the file (rotational coefficients are currently not reported).
- Corner coordinates in georeferenced, and if possible lat/long based on the full geotransform (but not GCPs).
- Ground control points.
- File wide (including subdatasets) metadata.
- Band data types.
- Band color interpretations.
- Band block size.
- Band descriptions.
- Band min/max values (internally known and possibly computed).
- Band checksum (if computation asked).
- Band NODATA value.
- Band overview resolutions available.
- Band unit type (i.e.. "meters" or "feet" for elevation bands).
- Band pseudo-color tables.
C API
This utility is also callable from C with GDALInfo().
Added in version 2.1.
Examples
Example 1: Default output format
$ gdalinfo utmsmall.tif Driver: GTiff/GeoTIFF Files: utmsmall.tif Size is 100, 100 Coordinate System is: PROJCRS["NAD27 / UTM zone 11N", BASEGEOGCRS["NAD27", DATUM["North American Datum 1927", ELLIPSOID["Clarke 1866",6378206.4,294.978698213898, LENGTHUNIT["metre",1]]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433]], ID["EPSG",4267]], CONVERSION["Transverse Mercator", METHOD["Transverse Mercator", ID["EPSG",9807]], PARAMETER["Latitude of natural origin",0, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8801]], PARAMETER["Longitude of natural origin",-117, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8802]], PARAMETER["Scale factor at natural origin",0.9996, SCALEUNIT["unity",1], ID["EPSG",8805]], PARAMETER["False easting",500000, LENGTHUNIT["metre",1], ID["EPSG",8806]], PARAMETER["False northing",0, LENGTHUNIT["metre",1], ID["EPSG",8807]]], CS[Cartesian,2], AXIS["easting",east, ORDER[1], LENGTHUNIT["metre",1]], AXIS["northing",north, ORDER[2], LENGTHUNIT["metre",1]], ID["EPSG",26711]] Data axis to CRS axis mapping: 1,2 Origin = (440720.000000000000000,3751320.000000000000000) Pixel Size = (60.000000000000000,-60.000000000000000) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left ( 440720.000, 3751320.000) (117d38'28.21"W, 33d54' 8.47"N) Lower Left ( 440720.000, 3745320.000) (117d38'26.75"W, 33d50'53.66"N) Upper Right ( 446720.000, 3751320.000) (117d34'34.59"W, 33d54' 9.62"N) Lower Right ( 446720.000, 3745320.000) (117d34'33.28"W, 33d50'54.82"N) Center ( 443720.000, 3748320.000) (117d36'30.71"W, 33d52'31.66"N) Band 1 Block=100x81 Type=Byte, ColorInterp=Gray
Example 2: JSON output
For corner coordinates formatted as decimal degree instead of the above degree, minute, second, inspect the wgs84Extent member of gdalinfo -json:
Example of JSON output with gdalinfo -json utmsmall.tif:
{ "description":"utmsmall.tif", "driverShortName":"GTiff", "driverLongName":"GeoTIFF", "files":[ "utmsmall.tif" ], "size":[ 100, 100 ], "coordinateSystem":{ "wkt":"PROJCRS[\"NAD27 / UTM zone 11N\",\n BASEGEOGCRS[\"NAD27\",\n DATUM[\"North American Datum 1927\",\n ELLIPSOID[\"Clarke 1866\",6378206.4,294.978698213898,\n LENGTHUNIT[\"metre\",1]]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n ID[\"EPSG\",4267]],\n CONVERSION[\"Transverse Mercator\",\n METHOD[\"Transverse Mercator\",\n ID[\"EPSG\",9807]],\n PARAMETER[\"Latitude of natural origin\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8801]],\n PARAMETER[\"Longitude of natural origin\",-117,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8802]],\n PARAMETER[\"Scale factor at natural origin\",0.9996,\n SCALEUNIT[\"unity\",1],\n ID[\"EPSG\",8805]],\n PARAMETER[\"False easting\",500000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8806]],\n PARAMETER[\"False northing\",0,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8807]]],\n CS[Cartesian,2],\n AXIS[\"easting\",east,\n ORDER[1],\n LENGTHUNIT[\"metre\",1]],\n AXIS[\"northing\",north,\n ORDER[2],\n LENGTHUNIT[\"metre\",1]],\n ID[\"EPSG\",26711]]", "dataAxisToSRSAxisMapping":[ 1, 2 ] }, "geoTransform":[ 440720.0, 60.0, 0.0, 3751320.0, 0.0, -60.0 ], "metadata":{ "":{ "AREA_OR_POINT":"Area" }, "IMAGE_STRUCTURE":{ "INTERLEAVE":"BAND" } }, "cornerCoordinates":{ "upperLeft":[ 440720.0, 3751320.0 ], "lowerLeft":[ 440720.0, 3745320.0 ], "lowerRight":[ 446720.0, 3745320.0 ], "upperRight":[ 446720.0, 3751320.0 ], "center":[ 443720.0, 3748320.0 ] }, "wgs84Extent":{ "type":"Polygon", "coordinates":[ [ [ -117.6420428, 33.9023684 ], [ -117.6416377, 33.848257 ], [ -117.5767844, 33.8485775 ], [ -117.5771485, 33.9026895 ], [ -117.6420428, 33.9023684 ] ] ] }, "bands":[ { "band":1, "block":[ 100, 81 ], "type":"Byte", "colorInterpretation":"Gray", "metadata":{ } } ], "stac":{ "proj:shape":[ 100, 100 ], "proj:wkt2":"PROJCRS[\"NAD27 / UTM zone 11N\",\n BASEGEOGCRS[\"NAD27\",\n DATUM[\"North American Datum 1927\",\n ELLIPSOID[\"Clarke 1866\",6378206.4,294.978698213898,\n LENGTHUNIT[\"metre\",1]]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n ID[\"EPSG\",4267]],\n CONVERSION[\"Transverse Mercator\",\n METHOD[\"Transverse Mercator\",\n ID[\"EPSG\",9807]],\n PARAMETER[\"Latitude of natural origin\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8801]],\n PARAMETER[\"Longitude of natural origin\",-117,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8802]],\n PARAMETER[\"Scale factor at natural origin\",0.9996,\n SCALEUNIT[\"unity\",1],\n ID[\"EPSG\",8805]],\n PARAMETER[\"False easting\",500000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8806]],\n PARAMETER[\"False northing\",0,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8807]]],\n CS[Cartesian,2],\n AXIS[\"easting\",east,\n ORDER[1],\n LENGTHUNIT[\"metre\",1]],\n AXIS[\"northing\",north,\n ORDER[2],\n LENGTHUNIT[\"metre\",1]],\n ID[\"EPSG\",26711]]", "proj:epsg":26711, "proj:projjson":{ "$schema":"https://proj.org/schemas/v0.7/projjson.schema.json", "type":"ProjectedCRS", "name":"NAD27 / UTM zone 11N", "base_crs":{ "type":"GeographicCRS", "name":"NAD27", "datum":{ "type":"GeodeticReferenceFrame", "name":"North American Datum 1927", "ellipsoid":{ "name":"Clarke 1866", "semi_major_axis":6378206.4, "inverse_flattening":294.978698213898 } }, "coordinate_system":{ "subtype":"ellipsoidal", "axis":[ { "name":"Geodetic latitude", "abbreviation":"Lat", "direction":"north", "unit":"degree" }, { "name":"Geodetic longitude", "abbreviation":"Lon", "direction":"east", "unit":"degree" } ] }, "id":{ "authority":"EPSG", "code":4267 } }, "conversion":{ "name":"Transverse Mercator", "method":{ "name":"Transverse Mercator", "id":{ "authority":"EPSG", "code":9807 } }, "parameters":[ { "name":"Latitude of natural origin", "value":0, "unit":"degree", "id":{ "authority":"EPSG", "code":8801 } }, { "name":"Longitude of natural origin", "value":-117, "unit":"degree", "id":{ "authority":"EPSG", "code":8802 } }, { "name":"Scale factor at natural origin", "value":0.9996, "unit":"unity", "id":{ "authority":"EPSG", "code":8805 } }, { "name":"False easting", "value":500000, "unit":"metre", "id":{ "authority":"EPSG", "code":8806 } }, { "name":"False northing", "value":0, "unit":"metre", "id":{ "authority":"EPSG", "code":8807 } } ] }, "coordinate_system":{ "subtype":"Cartesian", "axis":[ { "name":"Easting", "abbreviation":"", "direction":"east", "unit":"metre" }, { "name":"Northing", "abbreviation":"", "direction":"north", "unit":"metre" } ] }, "id":{ "authority":"EPSG", "code":26711 } }, "proj:transform":[ 440720.0, 60.0, 0.0, 3751320.0, 0.0, -60.0 ], "raster:bands":[ { "data_type":"uint8" } ], "eo:bands":[ { "name":"b1", "description":"Gray" } ] } }
Author
Frank Warmerdam <warmerdam@pobox.com>
Copyright
1998-2025