1GDALMDIMTRANSLATE(1) GDAL GDALMDIMTRANSLATE(1)
2
3
4
6 gdalmdimtranslate - Converts multidimensional data between different
7 formats, and perform subsetting.
8
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
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 NetCDF: Network Common Data
28 Form, Multidimensional VRT), or a "classic" 2D formats, if only
29 one single 2D array results of the other specified conversion
30 operations. When this option is not specified, the format is
31 guessed when possible from the extension of the destination
32 filename.
33
34 -co <NAME=VALUE>
35 Many formats have one or more optional creation options that can
36 be used to control particulars about the file created.
37
38 The creation options available vary by format driver, and some
39 simple formats have no creation options at all. A list of op‐
40 tions supported for a format can be listed with the --formats
41 command line option but the documentation for the format is the
42 definitive source of information on driver creation options.
43 See Raster drivers format specific documentation for legal cre‐
44 ation options for each format.
45
46 Array-level creation options may be passed by prefixing them
47 with ARRAY:. See GDALGroup::CopyFrom() for further details re‐
48 garding such options.
49
50 -array <array_spec>
51 Instead of converting the whole dataset, select one array, and
52 possibly perform operations on it. This option can be specified
53 several times to operate on different arrays.
54
55 <array_spec> may be just an array name, potentially using a
56 fully qualified syntax (/group/subgroup/array_name). Or it can
57 be a combination of options with the syntax: name={src_ar‐
58 ray_name}[,dstname={dst_array_name}][,trans‐
59 pose=[{axis1},{axis2},...][,view={view_expr}]
60
61 [{axis1},{axis2},...] is the argument of
62 GDALMDArray::Transpose(). For example, transpose=[1,0] switches
63 the axis order of a 2D array.
64
65 {view_expr} is the value of the viewExpr argument of
66 GDALMDArray::GetView()
67
68 When specifying a view_expr that performs a slicing or subset‐
69 ting on a dimension, the equivalent operation will be applied to
70 the corresponding indexing variable.
71
72 -group <group_spec>
73 Instead of converting the whole dataset, select one group, and
74 possibly perform operations on it. This option can be specified
75 several times to operate on different groups. If only one group
76 is specified, its content will be copied directly to the target
77 root group. If several ones are specified, they are copied under
78 the target root group
79
80 <group_spec> may be just a group name, potentially using a fully
81 qualified syntax (/group/subgroup/subsubgroup_name). Or it can
82 be a combination of options with the syntax:
83 name={src_group_name}[,dstname={dst_group_name}][,recursive=no]
84
85 -subset <subset_spec>
86 Performs a subsetting (trimming or slicing) operation along a
87 dimension, provided that it is indexed by a 1D variable of nu‐
88 meric or string data type, and whose values are monotically
89 sorted. <subset_spec> follows exactly the OGC WCS 2.0 KVP en‐
90 coding for subsetting.
91
92 That is dim_name(min_val,max_val) or dim_name(sliced_val) The
93 first syntax will subset the dimension dim_name to values in the
94 [min_val,max_val] range. The second syntax will slice the dimen‐
95 sion dim_name to value sliced_val (and this dimension will be
96 removed from the arrays that reference to it)
97
98 Using -subset is incompatible of specifying a view option in
99 -array.
100
101 -scaleaxes <scaleaxes_spec>
102 Applies a integral scale factor to one or several dimensions,
103 that is extract 1 value every N values (without resampling).
104
105 <scaleaxes_spec> follows exactly the syntax of the KVP encoding
106 of the SCALEAXES parameter of OGC WCS 2.0 Scaling Extension, but
107 limited to integer scale factors.
108
109 That is dim1_name(scale_factor)[,dim2_name(scale_factor)]*
110
111 Using -scaleaxes is incompatible of specifying a view option in
112 -array.
113
114 -oo <NAME=VALUE>
115 New in version 3.4.
116
117
118 Source dataset open option (format specific)
119
120 <src_dataset>
121 The source dataset name.
122
123 <dst_dataset>
124 The destination file name.
125
127 This utility is also callable from C with GDALMultiDimTranslate().
128
130 • Convert a netCDF file to a multidimensional VRT file
131
132 $ gdalmdimtranslate in.nc out.vrt
133
134 • Extract a 2D slice of a time,Y,X array
135
136 $ gdalmdimtranslate in.nc out.tif -subset 'time("2010-01-01")' -array temperature
137
138 • Subsample along X and Y axis
139
140 $ gdalmdimtranslate in.nc out.nc -scaleaxes "X(2),Y(2)"
141
142 • Reorder the values of a time,Y,X array along the Y axis from
143 top-to-bottom to bottom-to-top (or the reverse)
144
145 $ gdalmdimtranslate in.nc out.nc -array "name=temperature,view=[:,::-1,:]"
146
147 • Transpose an array that has X,Y,time dimension order to time,Y,X
148
149 $ gdalmdimtranslate in.nc out.nc -array "name=temperature,transpose=[2,1,0]"
150
152 Even Rouault <even.rouault@spatialys.com>
153
155 1998-2022
156
157
158
159
160 Sep 02, 2022 GDALMDIMTRANSLATE(1)