comparison gdal_translate.xml @ 0:1ac517097024 draft

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/gdal commit b964e8f7d7bb076d63a1c7bdfbbdba0f9074d517
author ecology
date Tue, 26 Feb 2019 11:49:47 -0500
parents
children 0c1062baa9a2
comparison
equal deleted inserted replaced
-1:000000000000 0:1ac517097024
1 <tool id="gdal_gdal_translate" name="GDAL Translate" version="@VERSION@">
2 <description>converts raster data between different formats.</description>
3 <macros>
4 <import>gdal_macros.xml</import>
5 </macros>
6 <expand macro="gdal_requirements" />
7
8 <command detect_errors="exit_code"><![CDATA[
9 gdal_translate
10
11 '$typeinput.input1' '$output'
12 #if $settings.advanced=='advanced'
13
14 #if str($settings.ot).strip()!=''
15 -ot $settings.ot
16 #end if
17
18 $settings.strict
19
20 #if str($settings.b).strip()!=''
21 $settings.b
22 #end if
23
24 #if str($settings.mask).strip()!=''
25 '$settings.mask'
26 #end if
27
28 #if $settings.condi_resample.resample=='resampling'
29 -r $settings.condi_resample.r
30 #end if
31
32 #if $settings.outsize.outsize=='outsize_x'
33 -outsize xsize $settings.outsize.outx$settings.outsize.outsize_percent
34 #else
35 -outsize ysize $settings.outsize.outy$settings.outsize.outsize_percent
36 #end if
37
38 #if $settings.condi_expand.expand=='expand'
39 -expand $settings.condi_expand.expand_value
40 #end if
41
42 #if $settings.condi_scale.scale=='scale'
43 -scale $settings.condi_scale.src_min $settings.condi_scale.src_max $settings.condi_scale.dst_min $settings.condi_scale.dst_max
44 #end if
45
46 #if $settings.condi_srcwin.srcwin=='srcwin'
47 -srcwin $settings.condi_srcwin.xoff $settings.condi_srcwin.yoff $settings.condi_srcwin.xsize $settings.condi_srcwin.ysize
48 #end if
49
50 #if $settings.condi_a_ullr.a_ullr=='a_ullr'
51 -a_ullr $settings.condi_a_ullr.ulx $settings.condi_a_ullr.uly $settings.condi_a_ullr.lrx $settings.condi_a_ullr.lry
52 #end if
53
54 $settings.epoeco
55 ## $settings.sds
56 $settings.stats
57 $settings.norat
58
59 #if str($settings.co).strip()!=''
60 -co '$settings.co'
61 #end if
62
63 #if str($settings.mo).strip()!=''
64 -mo '$settings.mo'
65 #end if
66
67 ## #if str($settings.oo).strip()!=''
68 ## -oo '$settings.oo'
69 ## #end if
70
71 #if str($settings.a_srs).strip()!=''
72 -a_srs '$settings.a_srs'
73 #end if
74
75 #end if
76 -q
77 -of '$of'
78
79 ]]></command>
80 <inputs>
81 <conditional name="typeinput">
82 <param type="select" name="input" label="Gdal raster supported input file" help="Choose between GTiff,VRT or netCDF. To perform a translate on a subdataset use the gdal information option 'create list of potential subdatasets' to have the usable subdatasets in a file. Then select this file and the subdataset you want to use.">
83 <option value="dataset">Data file</option>
84 <option value="subdataset">Subdataset</option>
85 </param>
86 <when value="dataset">
87 <param type="data" label="Input data" format="data" help="Select a file you want to convert in GTiff, VRT or netCDF" name="input1"/>
88 </when>
89 <when value="subdataset">
90 <param type="data" label="Tabular of subdatasets" name="subdata_tab"/>
91 <param name="input1" type="select" label="Chose your subdata">
92 <options from_dataset="subdata_tab">
93 <column name="value" index="0"/>
94 </options>
95 <sanitizer>
96 <valid initial="string.printable">
97 <add value="&quot;"/>
98 </valid>
99 </sanitizer>
100 </param>
101 </when>
102 </conditional>
103 <expand macro="gdal_param_of"/>
104 <conditional name="settings">
105 <expand macro="gdal_advanced_params_select"/>
106 <when value="advanced">
107 <expand macro="gdal_param_ot"/>
108 <param name="strict" type="boolean" truevalue="-strict" falsevalue="" checked="false" label="Don't be forgiving of mismatches and lost data" help="-strict"/>
109 <expand macro="gdal_param_b"/>
110 <param name="mask" type="text" label="Select an input band band to create output dataset mask band" help="-mask band e.g : -mask 1" value=""/>
111 <expand macro="gdal_param_r"/>
112 <expand macro="gdal_param_stats"/>
113 <expand macro="gdal_param_norat"/>
114 <expand macro="gdal_param_co"/>
115 <param name="mo" type="text" label="Pass a metadata key and value to set on the output dataset" help="-mo META-TAG=VALUE" value="" />
116
117 <!-- commented as the gdalversion need to be upgraded
118 <param name="oo" type="text" label="-oo" value="NAME=VALUE" />
119 <expand macro="gdal_param_oo"/>
120 -->
121
122 <conditional name="condi_expand">
123 <param name="expand" type="select" label="Expose a dataset with 1 band with a color table" help="-expand gray|rgb|rgba" >
124 <option value="no_expand" selected="true">Don't use the -expand option</option>
125 <option value="expand">Use the -expand option</option>
126 </param>
127 <when value="no_expand">
128 </when>
129 <when value="expand">
130 <param name="expand_value" type="select" label="Color table" multiple="False">
131 <option value="gray" selected="true">GRAY</option>
132 <option value="rgb">RGB</option>
133 <option value="rgba">RGBA</option>
134 </param>
135 </when>
136 </conditional>
137 <conditional name="outsize">
138 <param name="outsize" type="select" label="Set the size of the output file" help="-outsize in % or pixel. Default is 100%." >
139 <option value="outsize_x" selected="true">xsize</option>
140 <option value="outsize_y">ysize</option>
141 </param>
142 <when value="outsize_x">
143 <param name="outsize_percent" type="boolean" truevalue="%" falsevalue="" checked="true" label="Use percentage"/>
144 <param name="outx" label="xsize" type="integer" value="100" min="0"/>
145 </when>
146 <when value="outsize_y">
147 <param name="outsize_percent" type="boolean" truevalue="%" falsevalue="" checked="true" label="Use percentage"/>
148 <param name="outy" label="ysize" type="integer" value="100" min="0"/>
149 </when>
150 </conditional>
151 <conditional name="condi_scale">
152 <param name="scale" type="select" label="Rescale the input pixels values" help="-squale from the range src_min to src_max to the range dst_min to dst_max" >
153 <option value="no_scale" selected="true">Don't use the -scale option</option>
154 <option value="scale">Use the -scale option</option>
155 </param>
156 <when value="no_scale">
157 </when>
158 <when value="scale">
159 <param name="src_min" type="integer" label="src_min" value="0" min="0"/>
160 <param name="src_max" type="integer" label="src_max" value="0" min="0"/>
161 <param name="dst_min" type="integer" label="dst_min" value="0" min="0"/>
162 <param name="dst_max" type="integer" label="dst_max" value="0" min="0"/>
163 </when>
164 </conditional>
165 <conditional name="condi_srcwin">
166 <param name="srcwin" type="select" label="Selects a subwindow from the source image" help="-srcwin. Copying based on pixel/line location" >
167 <option value="no_srcwin" selected="true">Don't use the -srcwin option</option>
168 <option value="srcwin">Use the -srcwin option</option>
169 </param>
170 <when value="no_srcwin">
171 </when>
172 <when value="srcwin">
173 <param name="xoff" type="integer" label="xoff" value="0" min="0"/>
174 <param name="yoff" type="integer" label="yoff" value="0" min="0"/>
175 <param name="xsize" type="integer" label="xsize" value="0" min="0"/>
176 <param name="ysize" type="integer" label="ysize" value="0" min="0"/>
177 </when>
178 </conditional>
179 <conditional name="condi_a_ullr">
180 <param name="a_ullr" type="select" label="Assign/override the georeferenced bounds of the output file" help="-a_ullr ulx uly lrx lry. This assigns georeferenced bounds to the output file, ignoring what would have been derived from the source file. So this does not cause reprojection to the specified SRS" >
181 <option value="no_a_ullr" selected="true">Don't use the -a_ullr option</option>
182 <option value="a_ullr">Use the -a_ullr option</option>
183 </param>
184 <when value="no_a_ullr">
185 </when>
186 <when value="a_ullr">
187 <param name="ulx" type="integer" label="ulx" value="0"/>
188 <param name="uly" type="integer" label="uly" value="0"/>
189 <param name="lrx" type="integer" label="lrx" value="0"/>
190 <param name="lry" type="integer" label="lry" value="0"/>
191 </when>
192 </conditional>
193 <param name="epoeco" type="select" label="Display error when outside the source raster" multiple="False">
194 <option value="" selected="true">Default, no error</option>
195 <option value="-epo">-epo : Error when partially outside</option>
196 <option value="-eco">-eco : Error when completely outside</option>
197 </param>
198 <param name="a_srs" type="text" label="Override the projection" help="-a_srs. The srs_def may be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n or a file containing the WKT. No reprojection is done" value="" />
199
200 <!--
201 <param name="sds" type="boolean" truevalue="-sds" falsevalue="" checked="false" label="-sds" help="Copy all subdatasets of this file to individual output files. Use with formats like HDF or OGDI that have subdatasets. The output file naming scheme has changed in GDAL 1.11 (e.g. ofile_1.tif, ofile_2.tif)."/>
202 Ici il y a surement une gestion de fichiers de sorties multiple à faire
203 -->
204
205 </when>
206 </conditional>
207 </inputs>
208
209 <outputs>
210 <expand macro="gdal_output_change_format"/>
211 </outputs>
212
213
214 <tests>
215 <test>
216 <param name="input1" value="tinyworld.png"/>
217 <param name="of" value="GTiff" />
218 <param name="advanced" value="advanced"/>
219 <param name="a_ullr" value="a_ullr"/>
220 <param name="ulx" value="-180"/>
221 <param name="uly" value="90"/>
222 <param name="lrx" value="180"/>
223 <param name="lry" value="-90"/>
224 <param name="a_srs" value="WGS84"/>
225 <output name="output" file="tinyworld.tif"/>
226 </test>
227 </tests>
228
229 <help><![CDATA[
230 ===============
231 Gdal_translate
232 ===============
233
234 **What it does**
235
236 The gdal_translate utility can be used to convert raster data between different formats, potentially performing some operations like subsettings, resampling, and rescaling pixels in the process.
237
238 |
239
240 **How to use it**
241
242 Select from history a raster file/subdataset.
243
244 Specifiy output format using short name (http://www.gdal.org/formats_list.html).
245
246 |
247
248 **Advanced options and sources**
249
250 To see complete details and help section please check the official gdal sources.
251
252 http://www.gdal.org
253
254 http://www.gdal.org/gdal_translate.html
255
256 Raster Processing Tutorial : https://trac.osgeo.org/gdal/wiki/UserDocs/RasterProcTutorial
257 ]]></help>
258 <expand macro="gdal_citation"/>
259 </tool>