1 <?xml version="1.0" encoding="UTF-8"?>
3 /******************************************************************************
4 * $Id: gdalvrt.xsd 30648 2015-09-22 15:16:23Z rouault $
7 * Purpose: XML Schema for GDAL VRT files.
8 * Author: Even Rouault, <even dot rouault at spatialys dot com>
10 **********************************************************************
11 * Copyright (c) 2015, Even Rouault
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
20 * The above copyright notice and this permission notice shall be included
21 * in all copies or substantial portions of the Software.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 * DEALINGS IN THE SOFTWARE.
30 ****************************************************************************/
32 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="1.0">
33 <xs:element name="VRTDataset">
36 <xs:choice minOccurs="0" maxOccurs="unbounded">
37 <xs:element name="SRS" type="xs:string"/>
38 <xs:element name="GeoTransform" type="xs:string"/>
39 <xs:element name="GCPList" type="GCPListType"/>
40 <xs:element name="BlockXSize" type="nonNegativeInteger32"/>
41 <xs:element name="BlockYSize" type="nonNegativeInteger32"/>
42 <xs:element name="Metadata" type="MetadataType"/> <!-- may be repeated -->
43 <xs:element name="VRTRasterBand" type="VRTRasterBandType"/> <!-- may be repeated -->
44 <xs:element name="MaskBand" type="MaskBandType"/>
45 <xs:element name="GDALWarpOptions" type="GDALWarpOptionsType"/> <!-- only if subClass="VRTWarpedDataset" -->
46 <xs:element name="PansharpeningOptions" type="PansharpeningOptionsType"/> <!-- only if subClass="VRTPansharpenedDataset" -->
49 <xs:attribute name="subClass" type="xs:string"/>
50 <xs:attribute name="rasterXSize" type="nonNegativeInteger32" use="required"/>
51 <xs:attribute name="rasterYSize" type="nonNegativeInteger32" use="required"/>
55 <xs:simpleType name="nonNegativeInteger32">
56 <xs:restriction base="xs:nonNegativeInteger">
57 <xs:maxInclusive value="2147483647"/>
61 <xs:complexType name="GCPListType">
63 <xs:element name="GCP" type="GCPType" minOccurs="0" maxOccurs="unbounded"/>
65 <xs:attribute name="Projection" type="xs:string"/>
68 <xs:complexType name="GCPType">
69 <xs:attribute name="Id" type="xs:string"/>
70 <xs:attribute name="Info" type="xs:string"/>
71 <xs:attribute name="Pixel" type="xs:double" use="required"/>
72 <xs:attribute name="Line" type="xs:double" use="required"/>
73 <xs:attribute name="X" type="xs:double" use="required"/>
74 <xs:attribute name="Y" type="xs:double" use="required"/>
75 <xs:attribute name="Z" type="xs:double"/>
76 <xs:attribute name="GCPZ" type="xs:double"/> <!-- deprecated -->
79 <xs:complexType name="MetadataType">
82 <!--<xs:element name="MDI" type="MDIType" minOccurs="0" maxOccurs="unbounded"/>-->
83 <xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
86 <xs:attribute name="domain" type="xs:string"/>
87 <xs:attribute name="format" type="xs:string"/>
90 <xs:complexType name="GDALWarpOptionsType">
92 <xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
96 <xs:complexType name="PansharpeningOptionsType">
98 <xs:element name="Algorithm" type="xs:string" minOccurs="0" maxOccurs="1"/>
99 <xs:element name="AlgorithmOptions" type="AlgorithmOptionsType" minOccurs="0" maxOccurs="1"/>
100 <xs:element name="Resampling" type="xs:string" minOccurs="0" maxOccurs="1"/>
101 <xs:element name="NumThreads" type="xs:string" minOccurs="0" maxOccurs="1"/>
102 <xs:element name="BitDepth" type="xs:string" minOccurs="0" maxOccurs="1"/>
103 <xs:element name="NoData" type="NoDataOrNoneType" minOccurs="0" maxOccurs="1"/>
104 <xs:element name="SpatialExtentAdjustment" type="xs:string" minOccurs="0" maxOccurs="1"/>
105 <xs:element name="PanchroBand" type="PanchroBandType" minOccurs="1" maxOccurs="1"/>
106 <xs:element name="SpectralBand" type="SpectralBandType" minOccurs="1" maxOccurs="unbounded"/>
110 <xs:simpleType name="NoDataOrNoneType">
111 <xs:union memberTypes="xs:double xs:string" />
114 <xs:complexType name="PanchroBandType">
116 <xs:element name="SourceFilename" type="SourceFilenameType"/>
117 <xs:element name="SourceBand" type="xs:string"/> <!-- should be refined into xs:nonNegativeInteger or mask,xs:nonNegativeInteger -->
121 <xs:complexType name="SpectralBandType">
123 <xs:element name="SourceFilename" type="SourceFilenameType"/>
124 <xs:element name="SourceBand" type="xs:string"/> <!-- should be refined into xs:nonNegativeInteger or mask,xs:nonNegativeInteger -->
126 <xs:attribute name="dstBand" type="xs:nonNegativeInteger"/>
129 <xs:complexType name="AlgorithmOptionsType">
131 <xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
135 <xs:complexType name="MDIType">
137 <xs:extension base="xs:string">
138 <xs:attribute name="key" type="xs:string" use="required"/>
143 <xs:complexType name="VRTRasterBandType">
145 <xs:choice minOccurs="0" maxOccurs="unbounded">
146 <xs:element name="Description" type="xs:string"/>
147 <xs:element name="UnitType" type="xs:string"/>
148 <xs:element name="Offset" type="xs:double"/>
149 <xs:element name="Scale" type="xs:double"/>
150 <xs:element name="CategoryNames" type="CategoryNamesType"/>
151 <xs:element name="ColorTable" type="ColorTableType"/>
152 <xs:element name="NoDataValue" type="DoubleOrNanType"/>
153 <xs:element name="NodataValue" type="xs:double"/> <!-- typo: deprecated -->
154 <xs:element name="HideNoDataValue" type="ZeroOrOne"/>
155 <xs:element name="Metadata" type="MetadataType"/>
156 <xs:element name="ColorInterp" type="ColorInterpType"/>
157 <xs:element name="Overview" type="OverviewType"/>
158 <xs:element name="MaskBand" type="MaskBandType"/>
159 <xs:element name="Histograms" type="HistogramsType"/>
161 <!-- for a VRTSourcedRasterBand. Each element may be repeated -->
162 <xs:element name="SimpleSource" type="SimpleSourceType"/>
163 <xs:element name="ComplexSource" type="ComplexSourceType"/>
164 <xs:element name="AveragedSource" type="SimpleSourceType"/>
165 <xs:element name="KernelFilteredSource" type="KernelFilteredSourceType"/>
167 <!-- for a VRTDerivedRasterBand -->
168 <xs:element name="PixelFunctionType" type="xs:string"/>
169 <xs:element name="SourceTransferType" type="DataTypeType"/>
171 <!-- for a VRTRawRasterBand -->
172 <xs:element name="SourceFilename" type="SourceFilenameType"/>
173 <xs:element name="ImageOffset" type="xs:integer"/>
174 <xs:element name="PixelOffset" type="xs:integer"/>
175 <xs:element name="LineOffset" type="xs:integer"/>
176 <xs:element name="ByteOrder" type="xs:string"/>
179 <xs:attribute name="dataType" type="DataTypeType"/>
180 <xs:attribute name="band" type="xs:unsignedInt"/>
181 <xs:attribute name="subClass" type="VRTRasterBandSubClassType"/>
183 <xs:attribute name="BlockXSize" type="xs:unsignedInt"/> <!-- ignored -->
184 <xs:attribute name="BlockYSize" type="xs:unsignedInt"/> <!-- ignored -->
187 <xs:simpleType name="ZeroOrOne">
188 <xs:restriction base="xs:integer">
189 <xs:enumeration value="0"/>
190 <xs:enumeration value="1"/>
194 <xs:simpleType name="VRTRasterBandSubClassType">
195 <xs:restriction base="xs:string">
196 <xs:enumeration value="VRTWarpedRasterBand"/>
197 <xs:enumeration value="VRTDerivedRasterBand"/>
198 <xs:enumeration value="VRTRawRasterBand"/>
199 <xs:enumeration value="VRTPansharpenedRasterBand"/>
203 <xs:complexType name="MaskBandType">
204 <xs:sequence minOccurs="1" maxOccurs="1">
205 <xs:element name="VRTRasterBand" type="VRTRasterBandType"/>
209 <xs:complexType name="HistogramsType">
210 <xs:sequence minOccurs="0" maxOccurs="unbounded">
211 <xs:element name="HistItem" type="HistItemType"/>
215 <xs:complexType name="HistItemType">
217 <xs:choice minOccurs="0" maxOccurs="unbounded">
218 <xs:element name="HistMin" type="xs:double"/>
219 <xs:element name="HistMax" type="xs:double"/>
220 <xs:element name="BucketCount" type="xs:integer"/>
221 <xs:element name="IncludeOutOfRange" type="ZeroOrOne"/>
222 <xs:element name="Approximate" type="ZeroOrOne"/>
223 <xs:element name="HistCounts" type="xs:string"/>
228 <xs:complexType name="CategoryNamesType">
229 <xs:sequence minOccurs="0" maxOccurs="unbounded">
230 <xs:element name="Category" type="xs:string"/>
234 <xs:complexType name="ColorTableType">
235 <xs:sequence minOccurs="0" maxOccurs="unbounded">
236 <xs:element name="Entry" type="ColorTableEntryType"/>
240 <xs:complexType name="OverviewType">
242 <xs:choice minOccurs="0" maxOccurs="unbounded">
243 <xs:element name="SourceFilename" type="SourceFilenameType"/>
244 <xs:element name="SourceBand" type="xs:string"/> <!-- should be refined into xs:nonNegativeInteger or mask,xs:nonNegativeInteger -->
249 <xs:complexType name="ColorTableEntryType">
250 <xs:attribute name="c1" type="xs:unsignedInt" use="required"/>
251 <xs:attribute name="c2" type="xs:unsignedInt" use="required" />
252 <xs:attribute name="c3" type="xs:unsignedInt" use="required" />
253 <xs:attribute name="c4" type="xs:unsignedInt" />
256 <xs:simpleType name="DataTypeType">
257 <xs:restriction base="xs:string">
258 <xs:enumeration value="Byte"/>
259 <xs:enumeration value="UInt16"/>
260 <xs:enumeration value="Int16"/>
261 <xs:enumeration value="UInt32"/>
262 <xs:enumeration value="Int32"/>
263 <xs:enumeration value="Float32"/>
264 <xs:enumeration value="Float64"/>
265 <xs:enumeration value="CInt16"/>
266 <xs:enumeration value="CInt32"/>
267 <xs:enumeration value="CFloat32"/>
268 <xs:enumeration value="CFloat64"/>
272 <xs:simpleType name="ColorInterpType">
273 <xs:restriction base="xs:string">
274 <xs:enumeration value="Gray"/>
275 <xs:enumeration value="Palette"/>
276 <xs:enumeration value="Red"/>
277 <xs:enumeration value="Green"/>
278 <xs:enumeration value="Blue"/>
279 <xs:enumeration value="Alpha"/>
280 <xs:enumeration value="Hue"/>
281 <xs:enumeration value="Saturation"/>
282 <xs:enumeration value="Lightness"/>
283 <xs:enumeration value="Cyan"/>
284 <xs:enumeration value="Magenta"/>
285 <xs:enumeration value="Yellow"/>
286 <xs:enumeration value="Black"/>
287 <xs:enumeration value="YCbCr_Y"/>
288 <xs:enumeration value="YCbCr_Cb"/>
289 <xs:enumeration value="YCbCr_Cr"/>
290 <xs:enumeration value="Undefined"/>
294 <xs:group name="SimpleSourceElementsGroup">
296 <xs:choice minOccurs="0" maxOccurs="unbounded">
297 <xs:element name="SourceFilename" type="SourceFilenameType"/>
298 <xs:element name="OpenOptions" type="OpenOptionsType"/>
299 <xs:element name="SourceBand" type="xs:string"/> <!-- should be refined into xs:nonNegativeInteger or mask,xs:nonNegativeInteger -->
300 <xs:element name="SourceProperties" type="SourcePropertiesType"/>
301 <xs:element name="SrcRect" type="RectType"/>
302 <xs:element name="DstRect" type="RectType"/>
307 <xs:complexType name="OpenOptionsType">
309 <xs:element name="OOI" type="OOIType" minOccurs="0" maxOccurs="unbounded"/>
313 <xs:complexType name="OOIType">
315 <xs:extension base="xs:string">
316 <xs:attribute name="key" type="xs:string" use="required"/>
321 <xs:complexType name="SimpleSourceType">
322 <xs:group ref="SimpleSourceElementsGroup"/>
323 <xs:attribute name="resampling" type="xs:string"/>
326 <xs:group name="ComplexSourceElementsGroup">
328 <xs:choice minOccurs="0" maxOccurs="unbounded">
329 <xs:group ref="SimpleSourceElementsGroup"/>
330 <xs:element name="ScaleOffset" type="xs:double"/>
331 <xs:element name="ScaleRatio" type="xs:double"/>
332 <xs:element name="ColorTableComponent" type="xs:nonNegativeInteger"/>
333 <xs:element name="Exponent" type="xs:double"/>
334 <xs:element name="SrcMin" type="xs:double"/>
335 <xs:element name="SrcMax" type="xs:double"/>
336 <xs:element name="DstMin" type="xs:double"/>
337 <xs:element name="DstMax" type="xs:double"/>
338 <xs:element name="NODATA" type="DoubleOrNanType"/>
339 <xs:element name="LUT" type="xs:string"/>
344 <xs:complexType name="ComplexSourceType">
345 <xs:group ref="ComplexSourceElementsGroup"/>
346 <xs:attribute name="resampling" type="xs:string"/>
349 <xs:complexType name="KernelFilteredSourceType">
351 <xs:choice minOccurs="0" maxOccurs="unbounded">
352 <xs:group ref="ComplexSourceElementsGroup"/>
353 <xs:element name="Kernel" type="KernelType"/>
356 <xs:attribute name="resampling" type="xs:string"/>
359 <xs:complexType name="KernelType">
361 <xs:element name="Size" type="xs:nonNegativeInteger"/>
362 <xs:element name="Coefs" type="xs:string"/>
365 <xs:attribute name="normalized" type="ZeroOrOne"/>
368 <xs:simpleType name="DoubleOrNanType">
369 <xs:union memberTypes="xs:double NANType" />
372 <xs:simpleType name="NANType">
373 <xs:restriction base="xs:string">
374 <xs:enumeration value="nan"/>
375 <xs:enumeration value="NAN"/>
379 <xs:complexType name="SourceFilenameType">
381 <xs:extension base="xs:string">
382 <xs:attribute name="relativeToVRT" type="ZeroOrOne" />
383 <xs:attribute name="relativetoVRT" type="ZeroOrOne" /> <!-- typo: deprecated -->
384 <xs:attribute name="shared" type="OGRBooleanType"/>
389 <xs:simpleType name="OGRBooleanType">
390 <xs:restriction base="xs:string">
391 <xs:enumeration value="1"/>
392 <xs:enumeration value="0"/>
393 <xs:enumeration value="ON"/>
394 <xs:enumeration value="OFF"/>
395 <xs:enumeration value="on"/>
396 <xs:enumeration value="off"/>
397 <xs:enumeration value="YES"/>
398 <xs:enumeration value="NO"/>
399 <xs:enumeration value="yes"/>
400 <xs:enumeration value="no"/>
401 <xs:enumeration value="TRUE"/>
402 <xs:enumeration value="FALSE"/>
403 <xs:enumeration value="true"/>
404 <xs:enumeration value="false"/>
405 <xs:enumeration value="True"/>
406 <xs:enumeration value="False"/>
410 <xs:complexType name="SourcePropertiesType">
411 <xs:attribute name="RasterXSize" type="nonNegativeInteger32" />
412 <xs:attribute name="RasterYSize" type="nonNegativeInteger32" />
413 <xs:attribute name="DataType" type="DataTypeType" />
414 <xs:attribute name="BlockXSize" type="nonNegativeInteger32" />
415 <xs:attribute name="BlockYSize" type="nonNegativeInteger32" />
418 <xs:complexType name="RectType">
419 <xs:attribute name="xOff" type="xs:double" />
420 <xs:attribute name="yOff" type="xs:double" />
421 <xs:attribute name="xSize" type="nonNegativeDouble" />
422 <xs:attribute name="ySize" type="nonNegativeDouble" />
425 <xs:simpleType name="nonNegativeDouble">
426 <xs:restriction base="xs:double">
427 <xs:minExclusive value="0.0"/>