gdalmdiminfo
What is gdalmdiminfo?
gdalmdiminfo is the multidimensional counterpart to gdalinfo, designed for datasets with more than two spatial dimensions — NetCDF, HDF5, Zarr, VICAR, GRIB, and other container formats storing groups, arrays, and named dimensions. It reports groups, variables, dimension sizes, attributes, data types, and chunking in a JSON tree that reflects the dataset's actual hierarchical structure.
gdalmdiminfo [options] <datasetname>Commonly used options:
-oo <NAME>=<VALUE>— driver-specific open option-array <name>— report a single array by path-arrayoption <NAME>=<VALUE>— per-array option-limit <number>— limit reported values for large arrays-detailed— include detailed structure-option values-nopretty— emit compact JSON
Output is JSON by default, suitable for jq or downstream tooling.
When would you use gdalmdiminfo?
Use gdalmdiminfo whenever you open a genuinely multidimensional raster — a climate NetCDF with (time, lat, lon) variables, an HDF5 remote-sensing product with nested groups, or a Zarr store. gdalinfo on those files reports only the flat 2D view (or subdatasets), which hides the actual structure you need to understand. gdalmdiminfo climate.nc | jq '.arrays' gives you a clean inventory of variables, dimensions, and units.
This is the tool you run first on any unfamiliar multidimensional delivery — ERA5 reanalysis, MODIS HDF-EOS, CMIP6 outputs, bathymetry in NetCDF — to plan the extraction. Combine with gdalmdimtranslate to extract specific arrays, subset dimensions, and emit either a classic 2D raster or a new multidimensional dataset.
FAQs
How is gdalmdiminfo different from gdalinfo?
gdalinfo treats a dataset as a flat 2D raster (or a list of subdataset "views") and reports driver-native metadata. gdalmdiminfo uses GDAL's Multidim Data Model — it enumerates hierarchical groups, named dimensions, variables with arbitrary dimensionality, and dimension-coordinate variables. For NetCDF, HDF5, and Zarr, gdalmdiminfo is the correct introspection tool.
What does a "dimension" mean in this model?
A dimension is a named axis — time, latitude, longitude, pressure level, band — with a size and optionally an associated coordinate variable giving real-world values (e.g. "latitude in degrees north"). Arrays declare which dimensions they span. Understanding dimensions is prerequisite to subsetting correctly with gdalmdimtranslate -subset.
Why does my NetCDF file look different in gdalinfo?
Classic gdalinfo flattens each variable as a subdataset and loses group structure. If your NetCDF has nested groups (common in CF-compliant products) or time series longer than a flat stack, only gdalmdiminfo reveals the actual layout. Always prefer it for multidimensional files.
How do I script downstream extraction?
Pipe gdalmdiminfo JSON through jq to find array paths and dimension sizes, then call gdalmdimtranslate with -array and -subset options. For example: gdalmdiminfo file.nc | jq -r '.arrays | keys[]' lists available arrays, and gdalmdimtranslate file.nc out.tif -array temperature -subset "time(0)" extracts one time slice.