GDALMDIMTRANSLATE(1)

πŸ“¦
version 3.4.3 Β· 2 versions
, in epel 9

πŸ¦‹ GDALMDIMTRANSLATE(1) β€” the GDAL one, bestie πŸ’…

okay so real talk, this page lives in the GDAL manual and it's about gdalmdimtranslate, and honestly? it's lowkey iconic. let's get into it ✨


✨ NAME ✨

gdalmdimtranslate β€” Converts multidimensional data between different formats, and perform subsetting. periodt. that's the whole vibe 🫢


🌸 SYNOPSIS 🌸

gdalmdimtranslate [--help-general] [-co "NAME=VALUE"]*
                  [-of format] [-array <array_spec>]*
                  [-group <group_spec>]*
                  [-subset <subset_spec>]*
                  [-scaleaxes <scaleaxes_spec>]*
                  [-oo NAME=VALUE]*
                  <src_filename> <dst_filename>

πŸ’– DESCRIPTION πŸ’–

So the gdalmdimtranslate program converts multidimensional raster between different formats, and/or can perform selective conversion of specific arrays and groups, and/or subsetting operations. it's giving multitasking queen πŸ‘‘

The following command line parameters can appear in any order. no cap, any order, she does not care 🧚

  • -of <format> β€” Select the output format. This can be a format that supports multidimensional output (such as raster.netcdf, vrt_multidimensional), 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. she'll guess. she's smart like that ⭐
  • -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 --formats 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. yes bestie, the ARRAY: prefix is the moment πŸ’…

  • -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. go off, collect them like stickers πŸŽ€

<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}][,transpose=[{axis1},{axis2},...][,view={view_expr}]

(yes, that's the bracket situation exactly as the original has it β€” copy it verbatim and don't come for me πŸ™ˆ)

[{axis1},{axis2},...] is the argument of GDALMDArray::Transpose(). For example, transpose=[1,0] switches the axis order of a 2D array. literally just flips it, iconic πŸ”₯

{view_expr} is the value of the viewExpr argument of GDALMDArray::GetView()

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. she keeps things consistent, as she should πŸ’œ

  • -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 monotically 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). bye bye dimension πŸ‘‹

Using -subset is incompatible of specifying a view option in -array. like, they do NOT coexist bestie, pick a lane 😭
  • -scaleaxes <scaleaxes_spec> β€” Applies a integral scale factor to one or several dimensions, that is extract 1 value every N values (without resampling). skipping through, no resampling, we love a clean filter 🌈

<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 -scaleaxes is incompatible of specifying a view option in -array. same energy, no mixing πŸ’€
  • -oo <NAME=VALUE> β€” New in version 3.4. Source dataset open option (format specific). fresh out the oven πŸ“
  • <src_dataset> β€” The source dataset name. where we're pulling from πŸ’–
  • <dst_dataset> β€” The destination file name. where it's going πŸŽ€

πŸ‘‘ C API πŸ‘‘

This utility is also callable from C with GDALMultiDimTranslate(). she's bilingual, she does both πŸ’…


⭐ EXAMPLES ⭐

  • Convert a netCDF file to a multidimensional VRT file
$ gdalmdimtranslate in.nc out.vrt
  • Extract a 2D slice of a time,Y,X array
$ gdalmdimtranslate in.nc out.tif -subset 'time("2010-01-01")' -array temperature
  • Subsample along X and Y axis
$ gdalmdimtranslate in.nc out.nc -scaleaxes "X(2),Y(2)"
  • Reorder the values of a 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,:]"
  • 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> β€” legend behaviour, honestly 🫢

1998-2026


okay that's the whole page, bestie, you're basically a multidimensional data translator now πŸ’…βœ¨

sign-off era: this icon was brought to you by GDAL, dated Jan 08, 2026 β€” GDALMDIMTRANSLATE(1) and out πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from