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 <src_filename> <dst_filename>
16
18 gdalmdimtranslate program converts multidimensional raster between dif‐
19 ferent formats, and/or can perform selective conversion of specific ar‐
20 rays and groups, and/or subsetting operations.
21
22 The following command line parameters can appear in any order.
23
24 -of <format>
25 Select the output format. This can be a format that supports
26 multidimensional output (such as raster.netcdf, vrt_multidimen‐
27 sional), or a "classic" 2D formats, if only one single 2D array
28 results of the other specified conversion operations. When this
29 option is not specified, the format is guessed when possible
30 from the extension of the destination filename.
31
32 -co <NAME=VALUE>
33 Many formats have one or more optional creation options that can
34 be used to control particulars about the file created. For in‐
35 stance, the GeoTIFF driver supports creation options to control
36 compression, and whether the file should be tiled.
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 <array_spec>
47 Instead of converting the whole dataset, select one array, and
48 possibly perform operations on it. This option can be specified
49 several times to operate on different arrays.
50
51 <array_spec> may be just an array name, potentially using a
52 fully qualified syntax (/group/subgroup/array_name). Or it can
53 be a combination of options with the syntax: name={src_ar‐
54 ray_name}[,dstname={dst_array_name}][,trans‐
55 pose=[{axis1},{axis2},...][,view={view_expr}]
56
57 [{axis1},{axis2},...] is the argumet of GDALMDArray::Trans‐
58 pose(). For example, transpose=[1,0] switches the axis order of
59 a 2D array.
60
61 {view_expr} is the value of the viewExpr argument of GDALMDAr‐
62 ray::GetView()
63
64 When specifying a view_expr that performs a slicing or subset‐
65 ting on a dimension, the equivalent operation will be applied to
66 the corresponding indexing variable.
67
68 -group <group_spec>
69 Instead of converting the whole dataset, select one group, and
70 possibly perform operations on it. This option can be specified
71 several times to operate on different groups. If only one group
72 is specified, its contet will be copied directly to the target
73 root group. If several ones are specified, they are copied under
74 the target root group
75
76 <group_spec> may be just a group name, potentially using a fully
77 qualified syntax (/group/subgroup/subsubgroup_name). Or it can
78 be a combination of options with the syntax:
79 name={src_group_name}[,dstname={dst_group_name}][,recursive=no]
80
81 -subset <subset_spec>
82 Performs a subsetting (trimming or slicing) operation along a
83 dimension, provided that it is indexed by a 1D variable of nu‐
84 meric or string data type, and whose values are monotically
85 sorted. <subset_spec> follows exactly the OGC WCS 2.0 KVP en‐
86 coding for subsetting.
87
88 That is dim_name(min_val,max_val) or dim_name(sliced_val) The
89 first syntax will subset the dimension dim_name to values in the
90 [min_val,max_val] range. The second syntax will slice the dimen‐
91 sion dim_name to value sliced_val (and this dimension will be
92 removed from the arrays that reference to it)
93
94 Using -subset is incompatible of specifying a view option in
95 -array.
96
97 -scaleaxes <scaleaxes_spec>
98 Applies a integral scale factor to one or several dimensions,
99 that is extract 1 value every N values (without resampling).
100
101 <scaleaxes_spec> follows exactly the syntax of the KVP encoding
102 of the SCALEAXES parameter of OGC WCS 2.0 Scaling Extension, but
103 limited to integer scale factors.
104
105 That is dim1_name(scale_factor)[,dim2_name(scale_factor)]*
106
107 Using -scaleaxes is incompatible of specifying a view option in
108 -array.
109
110 <src_dataset>
111 The source dataset name.
112
113 <dst_dataset>
114 The destination file name.
115
117 This utility is also callable from C with GDALMultiDimTranslate().
118
120 • Convert a netCDF file to a multidimensional VRT file
121
122 $ gdalmdimtranslate in.nc out.vrt
123
124 • Extract a 2D slice of a time,Y,X array
125
126 $ gdalmdimtranslate in.nc out.tif -subset 'time("2010-01-01")' -array temperature
127
128 • Subsample along X and Y axis
129
130 $ gdalmdimtranslate in.nc out.nc -scaleaxes "X(2),Y(2)"
131
132 • Reorder the values of a time,Y,X array along the Y axis from
133 top-to-bottom to bottom-to-top (or the reverse)
134
135 $ gdalmdimtranslate in.nc out.nc -array "name=temperature,view=[:,::-1,:]"
136
137 • Transpose an array that has X,Y,time dimension order to time,Y,X
138
139 $ gdalmdimtranslate in.nc out.nc -array "name=temperature,transpose=[2,1,0]"
140
142 Even Rouault <even.rouault@spatialys.com>
143
145 1998-2021
146
147
148
149
150 Mar 24, 2021 GDALMDIMTRANSLATE(1)