1GDALMDIMTRANSLATE(1)                 GDAL                 GDALMDIMTRANSLATE(1)
2
3
4

NAME

6       gdalmdimtranslate  -  Converts  multidimensional data between different
7       formats, and perform subsetting.
8

SYNOPSIS

10          gdalmdimtranslate [--help-general] [-co "NAME=VALUE"]*
11                            [-of format] [-array <array_spec>]*
12                            [-group <group_spec>]*
13                            [-subset <subset_spec>]*
14                            [-scaleaxes <scaleaxes_spec>]*
15                            [-oo NAME=VALUE]*
16                            <src_filename> <dst_filename>
17

DESCRIPTION

19       gdalmdimtranslate program converts multidimensional raster between dif‐
20       ferent formats, and/or can perform selective conversion of specific ar‐
21       rays and groups, and/or subsetting operations.
22
23       The following command line parameters can appear in any order.
24
25       -of <format>
26              Select the output format. This can be  a  format  that  supports
27              multidimensional  output (such as raster.netcdf, vrt_multidimen‐
28              sional), or a "classic" 2D formats, if only one single 2D  array
29              results  of the other specified conversion operations. When this
30              option is not specified, the format  is  guessed  when  possible
31              from the extension of the destination filename.
32
33       -co <NAME=VALUE>
34              Many formats have one or more optional creation options that can
35              be used to control particulars about the file created.
36
37              The creation options available vary by format driver,  and  some
38              simple  formats  have  no creation options at all. A list of op‐
39              tions supported for a format can be listed  with  the  --formats
40              command  line option but the documentation for the format is the
41              definitive source of information  on  driver  creation  options.
42              See  raster_drivers format specific documentation for legal cre‐
43              ation options for each format.
44
45              Array-level creation options may be  passed  by  prefixing  them
46              with  ARRAY:.  See GDALGroup::CopyFrom() for further details re‐
47              garding such options.
48
49       -array <array_spec>
50              Instead of converting the whole dataset, select one  array,  and
51              possibly  perform operations on it. This option can be specified
52              several times to operate on different arrays.
53
54              <array_spec> may be just an  array  name,  potentially  using  a
55              fully  qualified  syntax (/group/subgroup/array_name). Or it can
56              be a combination  of  options  with  the  syntax:  name={src_ar‐
57              ray_name}[,dstname={dst_array_name}][,trans‐
58              pose=[{axis1},{axis2},...][,view={view_expr}]
59
60              [{axis1},{axis2},...] is the  argument  of   GDALMDArray::Trans‐
61              pose().  For example, transpose=[1,0] switches the axis order of
62              a 2D array.
63
64              {view_expr} is the value of the viewExpr argument  of  GDALMDAr‐
65              ray::GetView()
66
67              When  specifying  a view_expr that performs a slicing or subset‐
68              ting on a dimension, the equivalent operation will be applied to
69              the corresponding indexing variable.
70
71       -group <group_spec>
72              Instead  of  converting the whole dataset, select one group, and
73              possibly perform operations on it. This option can be  specified
74              several  times to operate on different groups. If only one group
75              is specified, its content will be copied directly to the  target
76              root group. If several ones are specified, they are copied under
77              the target root group
78
79              <group_spec> may be just a group name, potentially using a fully
80              qualified  syntax  (/group/subgroup/subsubgroup_name). Or it can
81              be   a    combination    of    options    with    the    syntax:
82              name={src_group_name}[,dstname={dst_group_name}][,recursive=no]
83
84       -subset <subset_spec>
85              Performs  a  subsetting  (trimming or slicing) operation along a
86              dimension, provided that it is indexed by a 1D variable  of  nu‐
87              meric  or  string  data  type,  and whose values are monotically
88              sorted.  <subset_spec> follows exactly the OGC WCS 2.0  KVP  en‐
89              coding for subsetting.
90
91              That  is  dim_name(min_val,max_val)  or dim_name(sliced_val) The
92              first syntax will subset the dimension dim_name to values in the
93              [min_val,max_val] range. The second syntax will slice the dimen‐
94              sion dim_name to value sliced_val (and this  dimension  will  be
95              removed from the arrays that reference to it)
96
97              Using  -subset  is  incompatible  of specifying a view option in
98              -array.
99
100       -scaleaxes <scaleaxes_spec>
101              Applies a integral scale factor to one  or  several  dimensions,
102              that is extract 1 value every N values (without resampling).
103
104              <scaleaxes_spec>  follows exactly the syntax of the KVP encoding
105              of the SCALEAXES parameter of OGC WCS 2.0 Scaling Extension, but
106              limited to integer scale factors.
107
108              That is dim1_name(scale_factor)[,dim2_name(scale_factor)]*
109
110              Using  -scaleaxes is incompatible of specifying a view option in
111              -array.
112
113       -oo <NAME=VALUE>
114              New in version 3.4.
115
116
117              Source dataset open option (format specific)
118
119       <src_dataset>
120              The source dataset name.
121
122       <dst_dataset>
123              The destination file name.
124

C API

126       This utility is also callable from C with GDALMultiDimTranslate().
127

EXAMPLES

129       • Convert a netCDF file to a multidimensional VRT file
130
131          $ gdalmdimtranslate in.nc out.vrt
132
133       • Extract a 2D slice of a time,Y,X array
134
135          $ gdalmdimtranslate in.nc out.tif -subset 'time("2010-01-01")' -array temperature
136
137       • Subsample along X and Y axis
138
139          $ gdalmdimtranslate in.nc out.nc -scaleaxes "X(2),Y(2)"
140
141       • Reorder the values  of  a  time,Y,X  array  along  the  Y  axis  from
142         top-to-bottom to bottom-to-top (or the reverse)
143
144          $ gdalmdimtranslate in.nc out.nc -array "name=temperature,view=[:,::-1,:]"
145
146       • Transpose an array that has X,Y,time dimension order to time,Y,X
147
148          $ gdalmdimtranslate in.nc out.nc -array "name=temperature,transpose=[2,1,0]"
149

AUTHOR

151       Even Rouault <even.rouault@spatialys.com>
152
154       1998-2022
155
156
157
158
159                                 May 04, 2022             GDALMDIMTRANSLATE(1)
Impressum