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                            [-if format]* [-of format]
12                            [-array <array_spec>]*
13                            [-group <group_spec>]*
14                            [-subset <subset_spec>]*
15                            [-scaleaxes <scaleaxes_spec>]*
16                            [-oo NAME=VALUE]*
17                            <src_filename> <dst_filename>
18

DESCRIPTION

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

C API

138       This utility is also callable from C with GDALMultiDimTranslate().
139

EXAMPLES

141       • Convert a netCDF file to a multidimensional VRT file
142
143          $ gdalmdimtranslate in.nc out.vrt
144
145       • Extract a 2D slice of a time,Y,X array
146
147          $ gdalmdimtranslate in.nc out.tif -subset 'time("2010-01-01")' -array temperature
148
149       • Subsample along X and Y axis
150
151          $ gdalmdimtranslate in.nc out.nc -scaleaxes "X(2),Y(2)"
152
153       • Reorder  the  values  of  a  time,Y,X  array  along  the  Y axis from
154         top-to-bottom to bottom-to-top (or the reverse)
155
156          $ gdalmdimtranslate in.nc out.nc -array "name=temperature,view=[:,::-1,:]"
157
158       • Transpose an array that has X,Y,time dimension order to time,Y,X
159
160          $ gdalmdimtranslate in.nc out.nc -array "name=temperature,transpose=[2,1,0]"
161

AUTHOR

163       Even Rouault <even.rouault@spatialys.com>
164
166       1998-2023
167
168
169
170
171                                 Oct 30, 2023             GDALMDIMTRANSLATE(1)
Impressum