GDAL-DATASET-IDENTIFY(1)

πŸ“¦
version 3.13.3 Β· 4 versions
, in alpine 3.24, arch rolling, ubuntu stonking

πŸ’– gdal-dataset-identify(1) β€” the GDAL manual, but make it cute

okay so bestie, sit down, hydrate, because we're about to talk about the coolest little glow-up in the GDAL family: gdal-dataset-identify. It lives in the GDAL manual, it's a command-line tool, and honestly? It's giving "who dis" energy in the best possible way. πŸ¦‹


✨ NAME ✨

gdal-dataset-identify β€” Identify driver opening dataset(s)

Added in version 3.12. πŸŽ€

So like, gdal dataset identify reports the name of drivers that can open one or several dataset(s). That's it. That's the whole job. And it ate. πŸ’…


🌸 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) [not available in pipelines]

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

Look at that list. Every single one. We're not skipping a single flag, bestie, that would be rude. πŸ”₯


πŸ‘‘ OPTIONS πŸ‘‘

The one you literally cannot skip

  • --filename <FILENAME> β€” Any file name or directory name. Required. May be repeated. (In the synopsis it also shows up as --input, --filename <FILENAME>, described as "File or directory name [may be repeated] [required]".) Yes, she's demanding, but she's worth it. πŸ’…

Output & vibes

  • -o, --output <OUTPUT> β€” Added in version 3.13. ✨

This is the output vector dataset, and at a minimum it will have the fields filename and driver. And if you also passed --detailed? Then it also gets layout (whose value can be, for example, COG), file_list (side-car files), has_crs, has_geotransform and has_overview. She's thorough. She's organized. She's your main character. 🧚

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.

⚠️ And now the important part, no cap: this is not a positional argument. So the -o or --output switch must be explicitly used before specifying the name. Do not just yeet the filename on there and hope. πŸ™ˆ
  • -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. So like, they're allowed in the group chat now, but they must bring their --output plus-one. πŸ‘‘

Scanning & recursion

  • -r, --recursive β€” Recursively scan files/folders for datasets. She goes deep. πŸ•³οΈβœ¨
  • --force-recursive β€” Recursively scan folders for datasets, forcing recursion in folders recognized as valid formats. Like, even when a folder looks like a valid format all on its own, she's still gonna peek inside. Nosy in the best way. πŸ”

Extra detail mode

  • --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. This is the "tell me everything, I want the tea" flag. β˜•

Failure reporting

  • --report-failures β€” Report failures if file type is unidentified. So when she doesn't know what something is, she says so out loud instead of staying quiet. Honesty! we love her. 😭

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). Not available in pipelines. 🀫

Options that show up in the synopsis options list

  • --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.

🫢 RETURN STATUS CODE 🫢

Okay so the vibe check on exit codes:

The program returns status code 0 in case of success, and non-zero in case of error. And lowkey the sweetest detail: non-blocking errors emitted as warnings are considered as a successful execution. So she's not gonna fail you for a little oopsie. She's generous like that. 🌸


πŸ”₯ EXAMPLES πŸ”₯

Example 1: Identifying a single file

$ gdal dataset identify NE1_50M_SR_W.tif

NE1_50M_SR_W.tif: GTiff

One file in, one driver out. Clean. Simple. Iconic. ✨

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"
   }
]

Look at the structure. Look at the name and driver keys. We love a well-behaved JSON array. πŸ˜ŒπŸ’…

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

She went through every subfolder and named every format. JPEG, PNG, GTiff, HFA β€” the whole friend group showed up to the party. πŸŽ‰

Example 4: Recursively scans subfolders and reports detailed information into a CSV file

$ gdal dataset identify --output out.csv --detailed -r 50m_raster/

--output + --detailed + -r and boom, you got yourself a CSV. Iconic triple threat. πŸ’–

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

Yes bestie, you can point her at a /vsicurl/ URL and she will tell you if that GeoTIFF is cloud optimized. That's the whole flex. COG check via vibe check. πŸ¦‹πŸ”₯


πŸŽ€ AUTHOR πŸŽ€

Even Rouault <even.rouault@spatialys.com>

(hi king πŸ‘‘ thank you for your service)


1998-2026


and that's the whole page bestie! this manual page came to you from the GDAL manual, and it was dated Aug 18, 2026 β€” so like, freshly stamped, still warm. go identify some datasets, you got this. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from