1 <?xml version="1.0" encoding="UTF-8"?>
3 /******************************************************************************
4 * $Id: ogrvrt.xsd 34203 2016-05-10 14:06:35Z rouault $
7 * Purpose: XML Schema for OGR VRT files.
8 * Author: Even Rouault, <even dot rouault at mines dash paris dot org>
10 **********************************************************************
11 * Copyright (c) 2012, 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="OGRVRTDataSource">
36 <xs:choice minOccurs="0" maxOccurs="unbounded">
37 <xs:element name="Metadata" type="MetadataType"/> <!-- may be repeated -->
38 <xs:element name="OGRVRTLayer" type="OGRVRTLayerType"/>
39 <xs:element name="OGRVRTWarpedLayer" type="OGRVRTWarpedLayerType"/>
40 <xs:element name="OGRVRTUnionLayer" type="OGRVRTUnionLayerType"/>
46 <xs:complexType name="MetadataType">
49 <!--<xs:element name="MDI" type="MDIType" minOccurs="0" maxOccurs="unbounded"/>-->
50 <xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
53 <xs:attribute name="domain" type="xs:string"/>
54 <xs:attribute name="format" type="xs:string"/>
57 <xs:complexType name="OGRVRTLayerType">
59 <xs:choice minOccurs="0" maxOccurs="unbounded">
60 <xs:element name="Metadata" type="MetadataType"/> <!-- may be repeated -->
61 <xs:element name="SrcDataSource" type="SrcDataSourceType">
63 <xs:documentation>Required element</xs:documentation>
66 <xs:element name="OpenOptions" type="OpenOptionsType">
68 <xs:documentation>Optional element</xs:documentation>
71 <xs:element name="SrcLayer" type="nonEmptyStringType">
73 <xs:documentation>SrcLayer or(eclusive) SrcSQL are required elements</xs:documentation>
76 <xs:element name="SrcSQL">
79 <xs:extension base="nonEmptyStringType">
80 <xs:attribute name="dialect" type="nonEmptyStringType"/>
85 <xs:element name="FID" type="FIDType"/>
86 <xs:element name="Style" type="nonEmptyStringType"/>
87 <xs:element name="GeometryType" type="GeometryTypeType">
89 <xs:documentation>Use GeometryField.GeometryType for multi-geometry field support.</xs:documentation>
92 <xs:element name="LayerSRS" type="nonEmptyStringType">
94 <xs:documentation>Use GeometryField.SRS for multi-geometry field support.</xs:documentation>
97 <xs:element name="Field" type="FieldType">
99 <xs:documentation>May be repeated</xs:documentation>
102 <xs:element name="GeometryField" type="GeometryFieldType">
104 <xs:documentation>May be repeated</xs:documentation>
107 <xs:element name="SrcRegion" type="SrcRegionType">
109 <xs:documentation>Use GeometryField.SrcRegion for multi-geometry field support.</xs:documentation>
112 <xs:element name="attrFilterPassThrough" type="OGRBooleanType">
114 <xs:documentation>Default to FALSE.</xs:documentation>
117 <xs:element name="FeatureCount" type="xs:integer"/>
118 <xs:group ref="ExtentType">
120 <xs:documentation>Use GeometryField.ExtentXMin, etc... for multi-geometry field support.</xs:documentation>
125 <xs:attribute name="name" type="nonEmptyStringType" use="required"/>
128 <xs:complexType name="OpenOptionsType">
130 <xs:element name="OOI" type="OOIType" minOccurs="0" maxOccurs="unbounded"/>
134 <xs:complexType name="OOIType">
136 <xs:extension base="nonEmptyStringType">
137 <xs:attribute name="key" type="xs:string"/>
142 <xs:complexType name="FIDType">
144 <xs:extension base="nonEmptyStringType">
145 <xs:attribute name="name" type="xs:string">
147 <xs:documentation>A user-facing name can be specified here so that a FID column name is reported even if it is not reported as a regular field.</xs:documentation>
154 <xs:group name="ExtentType">
156 <xs:element name="ExtentXMin" type="xs:double" minOccurs="1" maxOccurs="1"/>
157 <xs:element name="ExtentYMin" type="xs:double" minOccurs="1" maxOccurs="1"/>
158 <xs:element name="ExtentXMax" type="xs:double" minOccurs="1" maxOccurs="1"/>
159 <xs:element name="ExtentYMax" type="xs:double" minOccurs="1" maxOccurs="1"/>
163 <xs:complexType name="SrcDataSourceType">
165 <xs:extension base="nonEmptyStringType">
166 <xs:attribute name="relativeToVRT" type="OGRBooleanType" default="FALSE">
168 <xs:documentation>Default to FALSE.</xs:documentation>
171 <!-- alternate case -->
172 <xs:attribute name="relativetoVRT" type="OGRBooleanType" default="FALSE">
174 <xs:documentation>Default to FALSE.</xs:documentation>
177 <xs:attribute name="shared" type="OGRBooleanType"/>
182 <xs:simpleType name="nonEmptyStringType">
183 <xs:restriction base="xs:string">
184 <xs:minLength value="1"/>
188 <xs:simpleType name="GeometryTypeType">
189 <xs:restriction base="xs:string">
190 <xs:enumeration value="wkbNone"/>
191 <xs:enumeration value="wkbUnknown"/>
192 <xs:enumeration value="wkbPoint"/>
193 <xs:enumeration value="wkbLineString"/>
194 <xs:enumeration value="wkbPolygon"/>
195 <xs:enumeration value="wkbMultiPoint"/>
196 <xs:enumeration value="wkbMultiLineString"/>
197 <xs:enumeration value="wkbMultiPolygon"/>
198 <xs:enumeration value="wkbGeometryCollection"/>
199 <xs:enumeration value="wkbCircularString"/> <!-- new in GDAL 2.0 -->
200 <xs:enumeration value="wkbCompoundCurve"/> <!-- new in GDAL 2.0 -->
201 <xs:enumeration value="wkbCurvePolygon"/> <!-- new in GDAL 2.0 -->
202 <xs:enumeration value="wkbMultiCurve"/> <!-- new in GDAL 2.0 -->
203 <xs:enumeration value="wkbMultiSurface"/> <!-- new in GDAL 2.0 -->
204 <xs:enumeration value="wkbCurve"/> <!-- new in GDAL 2.1 -->
205 <xs:enumeration value="wkbSurface"/> <!-- new in GDAL 2.1 -->
206 <xs:enumeration value="wkbPoint25D"/>
207 <xs:enumeration value="wkbLineString25D"/>
208 <xs:enumeration value="wkbPolygon25D"/>
209 <xs:enumeration value="wkbMultiPoint25D"/>
210 <xs:enumeration value="wkbMultiLineString25D"/>
211 <xs:enumeration value="wkbMultiPolygon25D"/>
212 <xs:enumeration value="wkbGeometryCollection25D"/>
213 <xs:enumeration value="wkbCircularStringZ"/> <!-- new in GDAL 2.0 -->
214 <xs:enumeration value="wkbCompoundCurveZ"/> <!-- new in GDAL 2.0 -->
215 <xs:enumeration value="wkbCurvePolygonZ"/> <!-- new in GDAL 2.0 -->
216 <xs:enumeration value="wkbMultiCurveZ"/> <!-- new in GDAL 2.0 -->
217 <xs:enumeration value="wkbMultiSurfaceZ"/> <!-- new in GDAL 2.0 -->
218 <xs:enumeration value="wkbCurveZ"/> <!-- new in GDAL 2.1 -->
219 <xs:enumeration value="wkbSurfaceZ"/> <!-- new in GDAL 2.1 -->
221 <!-- below is new in GDAL 2.1 -->
222 <xs:enumeration value="wkbPointM"/>
223 <xs:enumeration value="wkbLineStringM"/>
224 <xs:enumeration value="wkbPolygonM"/>
225 <xs:enumeration value="wkbMultiPointM"/>
226 <xs:enumeration value="wkbMultiLineStringM"/>
227 <xs:enumeration value="wkbMultiPolygonM"/>
228 <xs:enumeration value="wkbGeometryCollectionM"/>
229 <xs:enumeration value="wkbCircularStringM"/>
230 <xs:enumeration value="wkbCompoundCurveM"/>
231 <xs:enumeration value="wkbCurvePolygonM"/>
232 <xs:enumeration value="wkbMultiCurveM"/>
233 <xs:enumeration value="wkbMultiSurfaceM"/>
234 <xs:enumeration value="wkbCurveM"/>
235 <xs:enumeration value="wkbSurfaceM"/>
237 <xs:enumeration value="wkbPointZM"/>
238 <xs:enumeration value="wkbLineStringZM"/>
239 <xs:enumeration value="wkbPolygonZM"/>
240 <xs:enumeration value="wkbMultiPointZM"/>
241 <xs:enumeration value="wkbMultiLineStringZM"/>
242 <xs:enumeration value="wkbMultiPolygonZM"/>
243 <xs:enumeration value="wkbGeometryCollectionZM"/>
244 <xs:enumeration value="wkbCircularStringZM"/>
245 <xs:enumeration value="wkbCompoundCurveZM"/>
246 <xs:enumeration value="wkbCurvePolygonZM"/>
247 <xs:enumeration value="wkbMultiCurveZM"/>
248 <xs:enumeration value="wkbMultiSurfaceZM"/>
249 <xs:enumeration value="wkbCurveZM"/>
250 <xs:enumeration value="wkbSurfaceZM"/>
255 <xs:complexType name="FieldTypeWithoutSrc">
256 <xs:attribute name="name" type="nonEmptyStringType" use="required"/>
257 <xs:attribute name="type" type="OGRFieldTypeType" default="String"/>
258 <xs:attribute name="subtype" type="OGRFieldSubTypeType" default="None"/> <!-- new in GDAL 2.0 -->
259 <xs:attribute name="width" type="xs:nonNegativeInteger"/>
260 <xs:attribute name="precision" type="xs:nonNegativeInteger"/>
261 <xs:attribute name="nullable" type="OGRBooleanType" default="true"/> <!-- new in GDAL 2.0 -->
262 <xs:attribute name="default" type="xs:string"/> <!-- new in GDAL 2.0 -->
265 <xs:complexType name="FieldType">
267 <xs:extension base="FieldTypeWithoutSrc">
268 <xs:attribute name="src" type="nonEmptyStringType">
270 <xs:documentation>Defaults to the value of "name" if not specified.</xs:documentation>
277 <xs:simpleType name="OGRFieldTypeType">
278 <xs:restriction base="xs:string">
279 <xs:enumeration value="Integer"/>
280 <xs:enumeration value="integer"/>
281 <xs:enumeration value="Integer64"/>
282 <xs:enumeration value="integer64"/>
283 <xs:enumeration value="Real"/>
284 <xs:enumeration value="real"/>
285 <xs:enumeration value="String"/>
286 <xs:enumeration value="string"/>
287 <xs:enumeration value="IntegerList"/>
288 <xs:enumeration value="integerlist"/>
289 <xs:enumeration value="Integer64List"/>
290 <xs:enumeration value="integer64list"/>
291 <xs:enumeration value="RealList"/>
292 <xs:enumeration value="reallist"/>
293 <xs:enumeration value="StringList"/>
294 <xs:enumeration value="stringlist"/>
295 <xs:enumeration value="Binary"/>
296 <xs:enumeration value="binary"/>
297 <xs:enumeration value="Date"/>
298 <xs:enumeration value="date"/>
299 <xs:enumeration value="Time"/>
300 <xs:enumeration value="time"/>
301 <xs:enumeration value="DateTime"/>
302 <xs:enumeration value="datetime"/>
306 <xs:simpleType name="OGRFieldSubTypeType">
307 <xs:restriction base="xs:string">
308 <xs:enumeration value="None"/>
309 <xs:enumeration value="Boolean"/>
310 <xs:enumeration value="Int16"/>
311 <xs:enumeration value="Float32"/>
315 <xs:simpleType name="EncodingType">
316 <xs:restriction base="xs:string">
317 <xs:enumeration value="Direct"/>
318 <xs:enumeration value="None"/>
319 <xs:enumeration value="WKT"/>
320 <xs:enumeration value="WKB"/>
321 <xs:enumeration value="Shape"/>
322 <xs:enumeration value="shape"/>
323 <xs:enumeration value="PointFromColumns"/>
327 <xs:attributeGroup name="GeometryFieldTypeAttrGroupWithoutSrc">
328 <xs:attribute name="encoding" type="EncodingType">
330 <xs:documentation>Defaults to Direct.</xs:documentation>
333 <xs:attribute name="name" type="xs:string">
335 <xs:documentation>Name of the geometry field</xs:documentation>
338 <xs:attribute name="x" type="nonEmptyStringType">
340 <xs:documentation>Only used if encoding = "PointFromColumns"</xs:documentation>
343 <xs:attribute name="y" type="nonEmptyStringType">
345 <xs:documentation>Only used if encoding = "PointFromColumns"</xs:documentation>
348 <xs:attribute name="z" type="nonEmptyStringType">
350 <xs:documentation>Only used if encoding = "PointFromColumns"</xs:documentation>
353 <xs:attribute name="m" type="nonEmptyStringType">
355 <xs:documentation>Only used if encoding = "PointFromColumns"</xs:documentation>
358 <xs:attribute name="useSpatialSubquery" type="OGRBooleanType">
360 <xs:documentation>Only used if encoding = "PointFromColumns". Defaults to TRUE.</xs:documentation>
363 <xs:attribute name="reportSrcColumn" type="OGRBooleanType">
365 <xs:documentation>Only used if no Field element is found at the OGRVRTLayer level</xs:documentation>
368 <xs:attribute name="nullable" type="OGRBooleanType" default="true"/> <!-- new in GDAL 2.0 -->
371 <xs:complexType name="GeometryFieldTypeWithoutSrc">
373 <xs:choice minOccurs="0" maxOccurs="unbounded">
374 <xs:element name="GeometryType" type="GeometryTypeType"/>
375 <xs:element name="SrcRegion" type="SrcRegionType"/>
376 <xs:element name="SRS" type="nonEmptyStringType"/>
377 <xs:group ref="ExtentType"/>
380 <xs:attributeGroup ref="GeometryFieldTypeAttrGroupWithoutSrc"/>
383 <xs:complexType name="GeometryFieldType">
385 <xs:extension base="GeometryFieldTypeWithoutSrc">
386 <xs:attribute name="field" type="nonEmptyStringType">
388 <xs:documentation>Used if encoding = "WKT", "WKB" or "Shape" to find
389 the attribute field of the source layer.
390 Used also in multiple geometry fields scenario to retrieve the
391 source geometry field matching the target VRT geometry field.</xs:documentation>
398 <xs:complexType name="SrcRegionType">
400 <xs:extension base="PolygonWKTType">
401 <xs:attribute name="clip" type="OGRBooleanType">
403 <xs:documentation>Defaults to FALSE.</xs:documentation>
410 <xs:simpleType name="PolygonWKTType">
412 <xs:documentation>A valid WKT for a POLYGON</xs:documentation>
414 <xs:restriction base="xs:string">
415 <xs:pattern value="POLYGON.*"/>
419 <xs:simpleType name="OGRBooleanType">
420 <xs:restriction base="xs:string">
421 <xs:enumeration value="1"/>
422 <xs:enumeration value="0"/>
423 <xs:enumeration value="ON"/>
424 <xs:enumeration value="OFF"/>
425 <xs:enumeration value="on"/>
426 <xs:enumeration value="off"/>
427 <xs:enumeration value="YES"/>
428 <xs:enumeration value="NO"/>
429 <xs:enumeration value="yes"/>
430 <xs:enumeration value="no"/>
431 <xs:enumeration value="TRUE"/>
432 <xs:enumeration value="FALSE"/>
433 <xs:enumeration value="true"/>
434 <xs:enumeration value="false"/>
438 <xs:complexType name="OGRVRTWarpedLayerType">
440 <xs:choice minOccurs="1" maxOccurs="1">
441 <xs:element name="OGRVRTLayer" type="OGRVRTLayerType"/>
442 <xs:element name="OGRVRTWarpedLayer" type="OGRVRTWarpedLayerType"/>
443 <xs:element name="OGRVRTUnionLayer" type="OGRVRTUnionLayerType"/>
445 <xs:element name="WarpedGeomFieldName" type="nonEmptyStringType" minOccurs="0" maxOccurs="1"/>
446 <xs:element name="SrcSRS" type="nonEmptyStringType" minOccurs="0" maxOccurs="1"/>
447 <xs:element name="TargetSRS" type="nonEmptyStringType" minOccurs="1" maxOccurs="1"/>
448 <xs:group ref="ExtentType" minOccurs="0" maxOccurs="1"/>
452 <xs:complexType name="OGRVRTUnionLayerType">
454 <xs:choice minOccurs="0" maxOccurs="unbounded">
455 <xs:element name="OGRVRTLayer" type="OGRVRTLayerType">
457 <xs:documentation>May be repeated</xs:documentation>
460 <xs:element name="OGRVRTWarpedLayer" type="OGRVRTWarpedLayerType">
462 <xs:documentation>May be repeated</xs:documentation>
465 <xs:element name="OGRVRTUnionLayer" type="OGRVRTUnionLayerType">
467 <xs:documentation>May be repeated</xs:documentation>
471 <xs:element name="GeometryType" type="GeometryTypeType">
473 <xs:documentation>Use GeometryField.GeometryType for multi-geometry field support.</xs:documentation>
476 <xs:element name="LayerSRS" type="nonEmptyStringType">
478 <xs:documentation>Use GeometryField.SRS for multi-geometry field support.</xs:documentation>
481 <xs:element name="FieldStrategy" type="FieldStrategyType">
483 <xs:documentation>Defaults to Union if no Field or GeometryField element is speicified.</xs:documentation>
486 <xs:element name="Field" type="FieldTypeWithoutSrc">
488 <xs:documentation>May be repeated</xs:documentation>
491 <xs:element name="GeometryField" type="GeometryFieldTypeWithoutSrc">
493 <xs:documentation>May be repeated</xs:documentation>
496 <xs:element name="PreserveSrcFID" type="OGRBooleanType">
498 <xs:documentation>Defaults to FALSE.</xs:documentation>
501 <xs:element name="SourceLayerFieldName" type="nonEmptyStringType">
503 <xs:documentation>Name of fields in which to place the name of the source layer of each feature.</xs:documentation>
506 <xs:element name="FeatureCount" type="xs:integer"/>
507 <xs:group ref="ExtentType">
509 <xs:documentation>Use GeometryField.ExtentXMin, etc. for multi-geometry field support.</xs:documentation>
514 <xs:attribute name="name" type="nonEmptyStringType" use="required"/>
517 <xs:simpleType name="FieldStrategyType">
518 <xs:restriction base="xs:string">
519 <xs:enumeration value="FirstLayer"/>
520 <xs:enumeration value="Union"/>
521 <xs:enumeration value="Intersection"/>