- testing 3.12.3+dfsg-1
- unstable 3.12.3+dfsg-1
- experimental 3.13.0~beta1+dfsg-1~exp1
| GDAL-DATASET-IDENTIFY(1) | GDAL | GDAL-DATASET-IDENTIFY(1) |
NAME¶
gdal-dataset-identify - Identify driver opening dataset(s)
Added in version 3.12.
gdal dataset identify reports the name of drivers that can open one or several dataset(s).
SYNOPSIS¶
Usage: gdal dataset identify [OPTIONS] <FILENAME> Identify driver opening dataset(s). Positional arguments:
--input, --filename <FILENAME> File or directory name [may be repeated] [required] Common Options:
-h, --help Display help message and exit
--json-usage Display usage as JSON document and exit
--config <KEY>=<VALUE> Configuration option [may be repeated]
-q, --quiet Quiet mode (no progress bar or warning message) Options:
-o, --output <OUTPUT> Output vector dataset (created by algorithm)
-f, --of, --format, --output-format <OUTPUT-FORMAT> Output format
--co, --creation-option <KEY>=<VALUE> Creation option [may be repeated]
--lco, --layer-creation-option <KEY>=<VALUE> Layer creation option [may be repeated]
-l, --output-layer <OUTPUT-LAYER> Output layer name
--overwrite Whether overwriting existing output dataset is allowed
-r, --recursive Recursively scan files/folders for datasets
--force-recursive Recursively scan folders for datasets, forcing recursion in folders recognized as valid formats
--detailed Most detailed output. Reports the presence of georeferencing, if a GeoTIFF file is cloud optimized, etc.
--report-failures Report failures if file type is unidentified
OPTIONS¶
- --filename <FILENAME>
- Any file name or directory name. Required. May be repeated
- -o, --output <OUTPUT>
- Added in version 3.13.
Output vector dataset that will have at a minimum fields filename and driver, and if --detailed is specified, also layout (whose value can be for example COG), file_list (side-car files), has_crs, has_geotransform and has_overview.
When this argument is not specified, the result report is emitted to the standard output stream, either as JSON or text (depending on --output-format), for command line execution, or in the output-string argument when used from the API.
Note that this is not a positional argument, so the -o or --output switch must be explicitly used before specifying the name.
- -f, --of, --format, --output-format json|text|<OTHER-VECTOR-FORMAT>
- Which output format to use. Default is JSON, or text when invoked from
command line.
Since GDAL 3.13, other GDAL vector formats with creation capabilities can be used, in which case --output must be specified.
- -r, --recursive
- Recursively scan files/folders for datasets.
- --force-recursive
- Recursively scan folders for datasets, forcing recursion in folders recognized as valid formats.
- --detailed
- Added in version 3.13.
Increases the level of details in the output. Reports the presence of georeferencing, if a GeoTIFF file is cloud optimized, etc.
- --report-failures
- Report failures if file type is unidentified.
RETURN STATUS CODE¶
The program returns status code 0 in case of success, and non-zero in case of error (non-blocking errors emitted as warnings are considered as a successful execution).
EXAMPLES¶
Example 1: Identifying a single file¶
$ gdal dataset identify NE1_50M_SR_W.tif NE1_50M_SR_W.tif: GTiff
Example 2: Identifying a single file with JSON output¶
$ gdal dataset identify --of=JSON NE1_50M_SR_W.tif
[
{
"name": "NE1_50M_SR_W.tif",
"driver": "GTiff"
} ]
Example 3: Recursive mode will scan subfolders and report the data format¶
$ gdal dataset identify -r 50m_raster/ NE1_50M_SR_W/ne1_50m.jpg: JPEG NE1_50M_SR_W/ne1_50m.png: PNG NE1_50M_SR_W/ne1_50m_20pct.tif: GTiff NE1_50M_SR_W/ne1_50m_band1.tif: GTiff NE1_50M_SR_W/ne1_50m_print.png: PNG NE1_50M_SR_W/NE1_50M_SR_W.aux: HFA NE1_50M_SR_W/NE1_50M_SR_W.tif: GTiff NE1_50M_SR_W/ne1_50m_sub.tif: GTiff NE1_50M_SR_W/ne1_50m_sub2.tif: GTiff
Example 4: Recursively scans subfolders and reports detailed information into a CSV file¶
$ gdal dataset identify --output out.csv --detailed -r 50m_raster/
Example 5: Check if a GeoTIFF file is cloud optimized using --detailed¶
The following returns driver, and image layout details: GTiff, layout=COG, has CRS, has geotransform, has overview(s)
$ gdal dataset identify /vsicurl/https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/36/Q/WD/2020/7/S2A_36QWD_20200701_0_L2A/TCI.tif --detailed
AUTHOR¶
Even Rouault <even.rouault@spatialys.com>
COPYRIGHT¶
1998-2026
| April 15, 2026 |