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