GDALMDIMTRANSLATE(1)
π GDALMDIMTRANSLATE(1) β bestie's guide to multidimensional glow-ups π
okay so this is the page for gdalmdimtranslate, and it lives in the GDAL manual, and honestly? it's a whole vibe. sit down, grab a snack π, we're converting multidimensional data together.
π NAME π
gdalmdimtranslate β converts multidimensional data between different formats, and perform subsetting.
like, it takes your multidimensional raster and gives it a new format, and it can also trim/slice bits off. the glow-up AND the edit. periodt. β¨
π¦ SYNOPSIS π¦
Usage: gdalmdimtranslate [--help] [--long-usage] [--help-general]
[-if <format>]... [-of <output_format>]
[-co <NAME>=<VALUE>]...
[[-array <array_spec>]...]
[-arrayoption <NAME>=<VALUE>]...
[[-group <group_spec>]...]
[-subset <subset_spec>]...
[-scaleaxes <scaleaxes_spec>] [-strict]
[-oo <NAME>=<VALUE>]... [--quiet]
<src_dataset> <dst_dataset>
π DESCRIPTION π
so gdalmdimtranslate converts a multidimensional raster between different formats, and/or it can do selective conversion of specific arrays and groups, and/or it can do subsetting operations. multitasking queen π
TIP: Equivalent in the new"gdal"command line interface: Seegdal mdim convert.
The following command line parameters can appear in any order. no pressure, no order, we're chill π«Ά
β¨ the options β¨
--helpβ Show this help message and exit.--help-generalβ Gives a brief usage message for the generic GDAL commandline options and exit.-q,--quietβ Suppress progress messages and other non-error output. silence, but make it intentional π€«-if <format>β Format/driver name to be attempted to open the input file(s). Usually you don't need to say this β it's for when automatic driver detection is being a hater and fails to pick the right driver, and you want to skip it entirely. This option can be repeated several times to specify several candidate drivers. Note that it does not force those drivers to open the dataset β like, it's a suggestion, not a decree. In particular, some drivers have requirements on file extensions.
Added in version 3.2.
-of <format>β Select the output format. This can be a format that supports multidimensional output (such as NetCDF: Network Common Data Form, Multidimensional VRT), or a "classic" 2D formats, if only one single 2D array results of the other specified conversion operations. When this option is not specified, the format is guessed when possible from the extension of the destination filename. it's giving "figure it out from the filename bestie" π-co <NAME>=<VALUE>β Many formats have one or more optional creation options that can be used to control particulars about the file created.
The creation options available vary by format driver, and some simple formats have no creation options at all. A list of options supported for a format can be listed with the --format command line option but the documentation for the format is the definitive source of information on driver creation options. See Raster drivers format specific documentation for legal creation options for each format.
Array-level creation options may be passed by prefixing them with ARRAY:. See GDALGroup::CopyFrom() for further details regarding such options.
-array <array_spec>β Instead of converting the whole dataset, select one array, and possibly perform operations on it. This option can be specified several times to operate on different arrays. cherry-picking, but make it data π
<array_spec> may be just an array name, potentially using a fully qualified syntax (/group/subgroup/array_name). Or it can be a combination of options with the syntax: name={src_array_name}[,dstname={dst_array_name}][,resample=yes][,transpose=[{axis1},{axis2},...][,view={view_expr}]
The following options are processed in that order:
resample=yesasks for the array to run throughGDALMDArray::GetResampled().[{axis1},{axis2},...]is the argument ofGDALMDArray::Transpose(). For example,transpose=[1,0]switches the axis order of a 2D array. See Example 5.{view_expr}is the value of theviewExprargument ofGDALMDArray::GetView(). See Example 4.
When specifying a view_expr that performs a slicing or subsetting on a dimension, the equivalent operation will be applied to the corresponding indexing variable. they go together, they're a package deal π
-arrayoption <NAME>=<VALUE>β Added in version 3.9.
Option passed to GDALGroup::GetMDArrayNames() to filter reported arrays. Such option is format specific. Consult driver documentation. This option may be used several times.
-group <group_spec>β Instead of converting the whole dataset, select one group, and possibly perform operations on it. This option can be specified several times to operate on different groups. If only one group is specified, its content will be copied directly to the target root group. If several ones are specified, they are copied under the target root group.
<group_spec> may be just a group name, potentially using a fully qualified syntax (/group/subgroup/subsubgroup_name). Or it can be a combination of options with the syntax: name={src_group_name}[,dstname={dst_group_name}][,recursive=no]
-subset <subset_spec>β Performs a subsetting (trimming or slicing) operation along a dimension, provided that it is indexed by a 1D variable of numeric or string data type, and whose values are monotonically sorted.<subset_spec>follows exactly the OGC WCS 2.0 KVP encoding for subsetting.
That is dim_name(min_val,max_val) or dim_name(sliced_val). The first syntax will subset the dimension dim_name to values in the [min_val,max_val] range. The second syntax will slice the dimension dim_name to value sliced_val (and this dimension will be removed from the arrays that reference to it).
Using-subsetis incompatible with specifying a view option in-array. pick a lane bestie π
See Example 2.
-scaleaxes <scaleaxes_spec>β Applies a integral scale factor to one or several dimensions, that is extract 1 value every N values (without resampling). skipping, not smoothing π
<scaleaxes_spec> follows exactly the syntax of the KVP encoding of the SCALEAXES parameter of OGC WCS 2.0 Scaling Extension, but limited to integer scale factors.
That is <dim1_name>(<scale_factor>)[,<dim2_name>(<scale_factor>)]...
Using-scaleaxesis incompatible with specifying a view option in-array.
See Example 3.
-strictβ By default, some failures during the translation are tolerated, such as not being able to write group attributes. When setting this option, such failures will cause the process to fail. no more "it's fine, whatever" energy β now it's real π€-oo <NAME>=<VALUE>β Added in version 3.4.
Source dataset open option (format specific).
<src_dataset>β The source dataset name.<dst_dataset>β The destination file name.
π 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). so like... warnings are fine, we're being forgiving π«Ά
π§ C API π§
This utility is also callable from C with GDALMultiDimTranslate(). yes she does both. versatility icon.
π₯ EXAMPLES π₯
Example 1: Convert a netCDF file to a multidimensional VRT file
gdalmdimtranslate in.nc out.vrt
Example 2: Extract a 2D slice of a time,Y,X array
gdalmdimtranslate in.nc out.tif -subset 'time("2010-01-01")' -array temperature
Example 3: Subsample along X and Y axis
gdalmdimtranslate in.nc out.nc -scaleaxes "X(2),Y(2)"
Example 4: Reorder the values of an array
Reorder the values of the time,Y,X array along the Y axis from top-to-bottom to bottom-to-top (or the reverse)
gdalmdimtranslate in.nc out.nc -array "name=temperature,view=[:,::-1,:]"
Example 5: Transpose an array that has X,Y,time dimension order to time,Y,X
gdalmdimtranslate in.nc out.nc -array "name=temperature,transpose=[2,1,0]"
πΈ AUTHOR πΈ
Even Rouault <even.rouault@spatialys.com>
π COPYRIGHT π
1998-2026
and that's the whole page bestie, no cap, you ate it π okay bye, this was GDALMDIMTRANSLATE(1) from the GDAL manual β the same page that's dated Aug 18, 2026 β and if you got this far you're literally the main character of multidimensional data. slay π¦β¨π
π¦ where this page comes from
- alpine 3.24: gdal-doc 3.13.3-r0 Β· MIT
- arch rolling: gdal 3.13.3-6 Β· MIT
- ubuntu stonking: gdal-bin 3.13.3+dfsg-1ubuntu4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms