.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "GDAL-MDIM-CONVERT" "1" "Nov 07, 2025" "" "GDAL" .SH NAME gdal-mdim-convert \- Convert a multidimensional dataset .sp Added in version 3.11. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX Usage: gdal mdim convert [OPTIONS] Convert a multidimensional dataset. Positional arguments: \-i, \-\-input Input raster or multidimensional raster dataset [required] \-o, \-\-output Output multidimensional raster dataset (created by algorithm) [required] Common Options: \-h, \-\-help Display help message and exit \-\-json\-usage Display usage as JSON document and exit \-\-config = Configuration option [may be repeated] \-q, \-\-quiet Quiet mode (no progress bar) Options: \-f, \-\-of, \-\-format, \-\-output\-format Output format \-\-co, \-\-creation\-option = Creation option [may be repeated] \-\-overwrite Whether overwriting existing output is allowed \-\-array Select a single array instead of converting the whole dataset. [may be repeated] \-\-array\-option = Option passed to GDALGroup::GetMDArrayNames() to filter arrays. [may be repeated] \-\-group Select a single group instead of converting the whole dataset. [may be repeated] \-\-subset Select a subset of the data. [may be repeated] \-\-scale\-axes Applies a integral scale factor to one or several dimensions [may be repeated] \-\-strict Turn warnings into failures. Advanced Options: \-\-oo, \-\-open\-option = Open options [may be repeated] \-\-if, \-\-input\-format Input formats [may be repeated] .EE .UNINDENT .UNINDENT .SH DESCRIPTION .sp \fBgdal mdim convert\fP can be used to convert multidimensional data between different formats. .sp The following options are available: .SS Standard options .INDENT 0.0 .TP .B \-f, \-\-of, \-\-format, \-\-output\-format Select the output format. This can be a format that supports multidimensional output (such as \fI\%NetCDF: Network Common Data Form\fP, \fI\%Multidimensional VRT\fP), or a \(dqclassic\(dq 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. .UNINDENT .INDENT 0.0 .TP .B \-\-co, \-\-creation\-option = Many formats have one or more optional creation options that can be used to control particulars about the file created. .sp 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 \fI\%\-\-format\fP command line option but the documentation for the format is the definitive source of information on driver creation options. See \fI\%Raster drivers\fP format specific documentation for legal creation options for each format. .sp Array\-level creation options may be passed by prefixing them with \fBARRAY:\fP\&. See \fI\%GDALGroup::CopyFrom()\fP for further details regarding such options. .UNINDENT .INDENT 0.0 .TP .B \-\-overwrite Allow program to overwrite existing target file or dataset. Otherwise, by default, \fBgdal\fP errors out if the target file or dataset already exists. .UNINDENT .INDENT 0.0 .TP .B \-\-array 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. .sp 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}] .sp The following options are processed in that order: .INDENT 7.0 .IP \(bu 2 \fBresample=yes\fP asks for the array to run through \fI\%GDALMDArray::GetResampled()\fP\&. .IP \(bu 2 .INDENT 2.0 .TP .B [{axis1},{axis2},...] is the argument of \fI\%GDALMDArray::Transpose()\fP\&. For example, transpose=[1,0] switches the axis order of a 2D array. See \fI\%Example 5\fP\&. .UNINDENT .IP \(bu 2 {view_expr} is the value of the \fIviewExpr\fP argument of \fI\%GDALMDArray::GetView()\fP\&. See \fI\%Example 4\fP\&. .UNINDENT .sp 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. .UNINDENT .INDENT 0.0 .TP .B \-\-array\-option = Option passed to \fI\%GDALGroup::GetMDArrayNames()\fP to filter reported arrays. Such option is format specific. Consult driver documentation. This option may be used several times. .UNINDENT .INDENT 0.0 .TP .B \-\-group 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 .sp 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] .UNINDENT .INDENT 0.0 .TP .B \-\-subset 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. follows exactly the \X'tty: link https://portal.opengeospatial.org/files/09-147r3'\fI\%OGC WCS 2.0 KVP encoding\fP\X'tty: link' for subsetting. .sp 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) .sp Using \-\-subset is incompatible with specifying a \fIview\fP option in \-\-array. .sp See \fI\%Example 2\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-scaleaxes Applies a integral scale factor to one or several dimensions, that is extract 1 value every N values (without resampling). .sp follows exactly the syntax of the KVP encoding of the SCALEAXES parameter of \X'tty: link https://portal.opengeospatial.org/files/12-039'\fI\%OGC WCS 2.0 Scaling Extension\fP\X'tty: link', but limited to integer scale factors. .sp That is ()[,()]... .sp Using \-\-scaleaxes is incompatible with specifying a \fIview\fP option in \-\-array. .sp See \fI\%Example 3\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-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. .UNINDENT .SS Advanced options .INDENT 0.0 .TP .B \-\-oo = Dataset open option (format specific). .sp May be repeated. .UNINDENT .INDENT 0.0 .TP .B \-\-if Format/driver name to be attempted to open the input file(s). It is generally not necessary to specify it, but it can be used to skip automatic driver detection, when it fails to select the appropriate driver. This option can be repeated several times to specify several candidate drivers. Note that it does not force those drivers to open the dataset. In particular, some drivers have requirements on file extensions. .sp May be repeated. .UNINDENT .SH EXAMPLES .SS Example 1: Convert a netCDF file to a multidimensional VRT file .INDENT 0.0 .INDENT 3.5 .sp .EX gdal mdim convert in.nc out.vrt .EE .UNINDENT .UNINDENT .SS Example 2: Extract a 2D slice of a time,Y,X array .INDENT 0.0 .INDENT 3.5 .sp .EX gdal mdim convert in.nc out.tif \-\-subset \(dqtime(\e\(dq2010\-01\-01\e\(dq)\(dq \-\-array temperature .EE .UNINDENT .UNINDENT .SS Example 3: Subsample along X and Y axis .INDENT 0.0 .INDENT 3.5 .sp .EX gdal mdim convert in.nc out.nc \-\-scaleaxes \(dqX(2),Y(2)\(dq .EE .UNINDENT .UNINDENT .SS Example 4: Reorder the values of an array .sp Reorder the values of the time,Y,X array along the Y axis from top\-to\-bottom to bottom\-to\-top (or the reverse) .INDENT 0.0 .INDENT 3.5 .sp .EX gdal mdim convert in.nc out.nc \-\-array \(dqname=temperature,view=[:,::\-1,:]\(dq .EE .UNINDENT .UNINDENT .SS Example 5: Transpose an array that has X,Y,time dimension order to time,Y,X .INDENT 0.0 .INDENT 3.5 .sp .EX gdal mdim convert in.nc out.nc \-\-array \(dqname=temperature,transpose=[2,1,0]\(dq .EE .UNINDENT .UNINDENT .SH AUTHOR Even Rouault .SH COPYRIGHT 1998-2025 .\" Generated by docutils manpage writer. .