0
|
1 <tool id="gdalinfo" name="GDAL Informations" version="0.1.0">
|
|
2 <description>lists information about a raster dataset</description>
|
|
3 <requirements>
|
|
4 <requirement type="package" version="2.1.0">gdal</requirement>
|
|
5 <requirement type="package" version="3.5.0">geos</requirement>
|
|
6 <requirement type="package" version="9b">jpeg</requirement>
|
|
7 <requirement type="package" version="1.5.90">libjpeg-turbo</requirement>
|
|
8 </requirements>
|
|
9 <command detect_errors="exit_code"><![CDATA[
|
|
10 gdalinfo '$input1'
|
|
11 #if $settings.advanced=='advanced'
|
|
12 $settings.mm
|
|
13 $settings.stats
|
|
14 $settings.approx_stats
|
|
15 $settings.hist
|
|
16 $settings.nogcp
|
|
17 $settings.nomd
|
|
18 $settings.norat
|
|
19 $settings.noct
|
|
20 $settings.checksum
|
|
21 $settings.listmdd
|
|
22 $settings.proj4
|
|
23 -mdd '$settings.mdd'
|
|
24 #end if
|
|
25 #if $format.value=='json'
|
|
26 -json > '$outputJson';
|
|
27 #if $subdataset=='subd_y'
|
|
28 cat '$outputJson' | grep -A 1 "\"SUBDATASET_._NAME\":\".*\"," | cut -d "\"" -f4- | sed 's/..$//' | sed 's/\t//' | sed -e 'N; s/\n/\t/' > '${input1.name}_Subdatasets'
|
|
29 #end if
|
|
30 #else
|
|
31 > '$outputDefault';
|
|
32 #if $subdataset=='subd_y'
|
|
33 cat '$outputDefault' | grep -A 1 "SUBDATASET_._NAME=.*:.*$" | cut -d "=" -f 2 | sed 's/\t//' | sed -e 'N; s/\n/\t/' > '${input1.name}_Subdatasets'
|
|
34 #end if
|
|
35 #end if
|
|
36 ]]></command>
|
|
37 <inputs>
|
|
38 <param type="data" name="input1" format="data" label="Gdal supported input file" help="http://www.gdal.org/formats_list.html"/>
|
|
39 <param name="format" type="select" label="Output format" display="radio" multiple="False">
|
|
40 <option value="default" selected="true">Text</option>
|
|
41 <option value="json">Json</option>
|
|
42 </param>
|
|
43 <param name="subdataset" type="select" label="Create list of potential subdatasets" display="radio" multiple="False">
|
|
44 <option value="subd_y">Yes</option>
|
|
45 <option value="subd_n" selected="True">No</option>
|
|
46 </param>
|
|
47 <conditional name="settings">
|
|
48 <param name="advanced" type="select" label="Specify advanced parameters">
|
|
49 <option value="simple" selected="true">No, use program defaults.</option>
|
|
50 <option value="advanced">Yes, see full parameter list.</option>
|
|
51 </param>
|
|
52 <when value="simple">
|
|
53 </when>
|
|
54 <when value="advanced">
|
|
55 <param name="mm" type="boolean" truevalue="-mm" falsevalue="" checked="false" label="-mm" help="Force computation of the actual min/max values for each band in the dataset."/>
|
|
56 <param name="stats" type="boolean" truevalue="-stats" falsevalue="" checked="false" label="-stats" help="Read and display image statistics. Force computation if no statistics are stored in an image."/>
|
|
57 <param name="approx_stats" type="boolean" truevalue="-approx_stats" falsevalue="" checked="false" label="-approx_stats" help="Read and display image statistics. Force computation if no statistics are stored in an image. However, they may be computed based on overviews or a subset of all tiles. Useful if you are in a hurry and don't want precise stats."/>
|
|
58 <param name="hist" type="boolean" truevalue="-hist" falsevalue="" checked="false" label="-hist" help="Report histogram information for all bands."/>
|
|
59 <param name="nogcp" type="boolean" truevalue="-nogcp" falsevalue="" checked="false" label="-nogcp" help="Suppress ground control points list printing. It may be useful for datasets with huge amount of GCPs, such as L1B AVHRR or HDF4 MODIS which contain thousands of them."/>
|
|
60 <param name="nomd" type="boolean" truevalue="-nomd" falsevalue="" checked="false" label="-nomd" help="Suppress metadata printing. Some datasets may contain a lot of metadata strings."/>
|
|
61 <param name="norat" type="boolean" truevalue="-norat" falsevalue="" checked="false" label="-norat" help="Suppress printing of raster attribute table."/>
|
|
62 <param name="noct" type="boolean" truevalue="-noct" falsevalue="" checked="false" label="-noct" help="Suppress printing of color table."/>
|
|
63 <param name="checksum" type="boolean" truevalue="-checksum" falsevalue="" checked="false" label="-checksum" help="Force computation of the checksum for each band in the dataset."/>
|
|
64 <param name="listmdd" type="boolean" truevalue="-listmdd" falsevalue="" checked="false" label="-listmdd" help="List all metadata domains available for the dataset."/>
|
|
65 <param name="proj4" type="boolean" truevalue="-proj4" falsevalue="" checked="false" label="-proj4" help="Report a PROJ.4 string corresponding to the file's coordinate system."/>
|
|
66 <param name="mdd" type="text" label="-mdd DOMAIN" help="Report metadata for the specified domain. Starting with GDAL 1.11, 'all' can be used to report metadata in all domains." value="all"/>
|
|
67 </when>
|
|
68 </conditional>
|
|
69
|
|
70 </inputs>
|
|
71 <outputs>
|
|
72 <data name="outputDefault" format="txt" label="Default info file">
|
|
73 <filter>format == "default"</filter>
|
|
74 </data>
|
|
75 <data name="outputJson" format="json" label="Json formated info file">
|
|
76 <filter>format == "json"</filter>
|
|
77 </data>
|
|
78 <data name="Subdatasets" format="tabular" from_work_dir="*_Subdatasets" label="Subdatasets from ${input1.name}">
|
|
79 <filter>subdataset == "subd_y"</filter>
|
|
80 </data>
|
|
81 </outputs>
|
|
82 <tests>
|
|
83 <test>
|
|
84 <param name="input1" value="stere.tif"/>
|
|
85 <param name="format" value="json" />
|
|
86 <param name="subdataset" value="subd_n" />
|
|
87 <param name="advanced" value="simple"/>
|
|
88 <output name="outputJson" file="stere_info.json" lines_diff="6"/>
|
|
89 </test>
|
|
90 <test>
|
|
91 <param name="input1" value="stere.tif"/>
|
|
92 <param name="format" value="default" />
|
|
93 <param name="subdataset" value="subd_n" />
|
|
94 <param name="advanced" value="advanced"/>
|
|
95 <param name="stats" value="-stats"/>
|
|
96 <param name="hist" value="-hist"/>
|
|
97 <param name="checksum" value="-checksum"/>
|
|
98 <param name="mdd" value="all"/>
|
|
99 <output name="outputDefault" file="stere_advanced_info.txt" lines_diff="6"/>
|
|
100 </test>
|
|
101 </tests>
|
|
102 <help><![CDATA[
|
|
103 ==========================
|
|
104 Gdalinfo
|
|
105 ==========================
|
|
106 **What it does**
|
|
107
|
|
108 The gdalinfo program lists various information about a GDAL supported raster dataset.
|
|
109
|
|
110 It will report all of the following (if known):
|
|
111
|
|
112 - The format driver used to access the file.
|
|
113 - Raster size (in pixels and lines).
|
|
114 - The coordinate system for the file (in OGC WKT).
|
|
115 - The geotransform associated with the file (rotational coefficients are currently not reported).
|
|
116 - Corner coordinates in georeferenced, and if possible lat/long based on the full geotransform (but not GCPs).
|
|
117 - Ground control points.
|
|
118 - File wide (including subdatasets) metadata.
|
|
119 - Band data types.
|
|
120 - Band color interpretations.
|
|
121 - Band block size.
|
|
122 - Band descriptions.
|
|
123 - Band min/max values (internally known and possibly computed).
|
|
124 - Band checksum (if computation asked).
|
|
125 - Band NODATA value.
|
|
126 - Band overview resolutions available.
|
|
127 - Band unit type (i.e.. "meters" or "feet" for elevation bands).
|
|
128 - Band pseudo-color tables.
|
|
129
|
|
130 |
|
|
131
|
|
132 **How to use it**
|
|
133
|
|
134 Select from history a suported raster file and choose either Json or Text format for result display.
|
|
135
|
|
136 An additional option can list available subdatasets.
|
|
137
|
|
138 |
|
|
139
|
|
140 **Other options, advanced usage**
|
|
141
|
|
142
|
|
143 *-mm*
|
|
144
|
|
145 Force computation of the actual min/max values for each band in the dataset.
|
|
146
|
|
147 |
|
|
148
|
|
149 *-stats*
|
|
150
|
|
151 Read and display image statistics. Force computation if no statistics are stored in an image.
|
|
152
|
|
153 |
|
|
154
|
|
155 *-approx_stats*
|
|
156
|
|
157 Read and display image statistics. Force computation if no statistics are stored in an image. However, they may be computed based on overviews or a subset of all tiles. Useful if you are in a hurry and don't want precise stats.
|
|
158
|
|
159 |
|
|
160
|
|
161 *-hist*
|
|
162
|
|
163 Report histogram information for all bands.
|
|
164
|
|
165 |
|
|
166
|
|
167 *-nogcp*
|
|
168
|
|
169 Suppress ground control points list printing. It may be useful for datasets with huge amount of GCPs, such as L1B AVHRR or HDF4 MODIS which contain thousands of them.
|
|
170
|
|
171 |
|
|
172
|
|
173 *-nomd*
|
|
174
|
|
175 Suppress metadata printing. Some datasets may contain a lot of metadata strings.
|
|
176
|
|
177 |
|
|
178
|
|
179 *-norat*
|
|
180
|
|
181 Suppress printing of raster attribute table.
|
|
182
|
|
183 |
|
|
184
|
|
185 *-noct*
|
|
186
|
|
187 Suppress printing of color table.
|
|
188
|
|
189 |
|
|
190
|
|
191 *-checksum*
|
|
192
|
|
193 Force computation of the checksum for each band in the dataset.
|
|
194
|
|
195 |
|
|
196
|
|
197 *-listmdd*
|
|
198
|
|
199 List all metadata domains available for the dataset.
|
|
200
|
|
201 |
|
|
202
|
|
203 *-mdd domain*
|
|
204
|
|
205 Report metadata for the specified domain. Starting with GDAL 1.11, "all" can be used to report metadata in all domains
|
|
206
|
|
207 |
|
|
208
|
|
209 *-proj4*
|
|
210
|
|
211 Report a PROJ.4 string corresponding to the file's coordinate system.
|
|
212
|
|
213 |
|
|
214
|
|
215 **Sources**
|
|
216
|
|
217 http://www.gdal.org
|
|
218
|
|
219 http://www.gdal.org/gdalinfo.html
|
|
220
|
|
221 Raster Processing Tutorial : https://trac.osgeo.org/gdal/wiki/UserDocs/RasterProcTutorial
|
|
222
|
|
223
|
|
224 ]]></help>
|
|
225 </tool>
|