geometry.xsd 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- File: geometry.xsd -->
  3. <schema targetNamespace="http://www.opengis.net/gml"
  4. xmlns="http://www.w3.org/2001/XMLSchema"
  5. xmlns:gml="http://www.opengis.net/gml"
  6. xmlns:xlink="http://www.w3.org/1999/xlink"
  7. elementFormDefault="qualified"
  8. version="2.05a">
  9. <annotation>
  10. <appinfo>geometry.xsd v2.05a 2001-06</appinfo>
  11. <documentation xml:lang="en">
  12. GML Geometry schema. Copyright (c) 2001 OGC, All Rights Reserved.
  13. Modified to comply with http://www.w3.org/2001/XMLSchema.
  14. Support for null-able and empty geometries has been added.
  15. </documentation>
  16. </annotation>
  17. <!-- bring in the XLink attributes -->
  18. <import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlinks.xsd"/>
  19. <!-- ==============================================================
  20. global declarations
  21. =================================================================== -->
  22. <element name="_Geometry" type="gml:AbstractGeometryType" abstract="true"/>
  23. <element name="_GeometryCollectionBase" type="gml:AbstractGeometryCollectionBaseType"
  24. abstract="true" substitutionGroup="gml:_Geometry"/>
  25. <element name="_GeometryCollection" type="gml:GeometryCollectionType"
  26. abstract="true" substitutionGroup="gml:_GeometryCollectionBase"/>
  27. <element name="geometryMember" type="gml:GeometryAssociationType"/>
  28. <!-- primitive geometry elements -->
  29. <element name="Point" type="gml:PointType" substitutionGroup="gml:_Geometry" nillable="true"/>
  30. <element name="LineString" type="gml:LineStringType"
  31. substitutionGroup="gml:_Geometry" nillable="true"/>
  32. <element name="LinearRing" type="gml:LinearRingType"
  33. substitutionGroup="gml:_Geometry"/>
  34. <element name="Polygon" type="gml:PolygonType"
  35. substitutionGroup="gml:_Geometry" nillable="true"/>
  36. <element name="Box" type="gml:BoxType"/>
  37. <!-- aggregate geometry elements -->
  38. <element name="MultiGeometry" type="gml:GeometryCollectionType" nillable="true"/>
  39. <element name="MultiPoint" type="gml:MultiPointType"
  40. substitutionGroup="gml:_GeometryCollection" nillable="true"/>
  41. <element name="MultiLineString" type="gml:MultiLineStringType"
  42. substitutionGroup="gml:_GeometryCollection" nillable="true"/>
  43. <element name="MultiPolygon" type="gml:MultiPolygonType"
  44. substitutionGroup="gml:_GeometryCollection" nillable="true"/>
  45. <!-- coordinate elements -->
  46. <element name="coord" type="gml:CoordType"/>
  47. <element name="coordinates" type="gml:CoordinatesType"/>
  48. <!-- this attribute gives the location where an element is defined -->
  49. <attribute name="remoteSchema" type="anyURI" />
  50. <!-- ==============================================================
  51. abstract supertypes
  52. =================================================================== -->
  53. <complexType name="AbstractGeometryType" abstract="true">
  54. <annotation>
  55. <documentation>
  56. All geometry elements are derived from this abstract supertype;
  57. a geometry element may have an identifying attribute ('gid').
  58. It may be associated with a spatial reference system.
  59. </documentation>
  60. </annotation>
  61. <attribute name="gid" type="ID" use="optional"/>
  62. <attribute name="srsName" type="anyURI" use="optional"/>
  63. </complexType>
  64. <complexType name="AbstractGeometryCollectionBaseType" abstract="true">
  65. <annotation>
  66. <documentation>
  67. This abstract base type for geometry collections just makes the
  68. srsName attribute mandatory.
  69. </documentation>
  70. </annotation>
  71. <complexContent>
  72. <restriction base="gml:AbstractGeometryType">
  73. <attribute name="gid" type="ID" use="optional"/>
  74. <attribute name="srsName" type="anyURI" use="required"/>
  75. </restriction>
  76. </complexContent>
  77. </complexType>
  78. <attributeGroup name="AssociationAttributeGroup">
  79. <annotation>
  80. <documentation>
  81. These attributes can be attached to any element, thus allowing it
  82. to act as a pointer. The 'remoteSchema' attribute allows an element
  83. that carries link attributes to indicate that the element is declared
  84. in a remote schema rather than by the schema that constrains the
  85. current document instance.
  86. </documentation>
  87. </annotation>
  88. <attributeGroup ref="xlink:simpleLink"/>
  89. <attribute ref="gml:remoteSchema" use="optional"/>
  90. </attributeGroup>
  91. <complexType name="GeometryAssociationType">
  92. <annotation>
  93. <documentation>
  94. A geometryMember encapsulates any primitive geometry element.
  95. Alternatively, it can function as a simple link that points to a
  96. remote geometry.
  97. </documentation>
  98. </annotation>
  99. <sequence>
  100. <element ref="gml:_Geometry" minOccurs="0"/>
  101. </sequence>
  102. <attributeGroup ref="gml:AssociationAttributeGroup"/>
  103. </complexType>
  104. <!-- ==============================================================
  105. primitive geometry types
  106. =================================================================== -->
  107. <complexType name="PointType">
  108. <annotation>
  109. <documentation>
  110. A Point is defined by a single coordinate tuple.
  111. </documentation>
  112. </annotation>
  113. <complexContent>
  114. <extension base="gml:AbstractGeometryType">
  115. <sequence minOccurs="0">
  116. <choice>
  117. <element ref="gml:coord"/>
  118. <element ref="gml:coordinates"/>
  119. </choice>
  120. </sequence>
  121. </extension>
  122. </complexContent>
  123. </complexType>
  124. <complexType name="LineStringType">
  125. <annotation>
  126. <documentation>
  127. A LineString is defined by two or more coordinate tuples, with
  128. linear interpolation between them.
  129. </documentation>
  130. </annotation>
  131. <complexContent>
  132. <extension base="gml:AbstractGeometryType">
  133. <sequence minOccurs="0">
  134. <choice>
  135. <element ref="gml:coord" minOccurs="2" maxOccurs="unbounded"/>
  136. <element ref="gml:coordinates"/>
  137. </choice>
  138. </sequence>
  139. </extension>
  140. </complexContent>
  141. </complexType>
  142. <complexType name="LinearRingType">
  143. <annotation>
  144. <documentation>
  145. A LinearRing is defined by four or more coordinate tuples, with
  146. linear interpolation between them; the first and last coordinates
  147. must be coincident.
  148. </documentation>
  149. </annotation>
  150. <complexContent>
  151. <extension base="gml:AbstractGeometryType">
  152. <sequence minOccurs="0">
  153. <choice>
  154. <element ref="gml:coord" minOccurs="4" maxOccurs="unbounded"/>
  155. <element ref="gml:coordinates"/>
  156. </choice>
  157. </sequence>
  158. </extension>
  159. </complexContent>
  160. </complexType>
  161. <complexType name="BoxType">
  162. <annotation>
  163. <documentation>
  164. The Box structure defines an extent using a pair of coordinate tuples.
  165. </documentation>
  166. </annotation>
  167. <complexContent>
  168. <extension base="gml:AbstractGeometryType">
  169. <sequence minOccurs="0">
  170. <choice>
  171. <element ref="gml:coord" minOccurs="2" maxOccurs="2"/>
  172. <element ref="gml:coordinates"/>
  173. </choice>
  174. </sequence>
  175. </extension>
  176. </complexContent>
  177. </complexType>
  178. <complexType name="PolygonType">
  179. <annotation>
  180. <documentation>
  181. A Polygon is defined by an outer boundary and zero or more inner
  182. boundaries which are in turn defined by LinearRings.
  183. </documentation>
  184. </annotation>
  185. <complexContent>
  186. <extension base="gml:AbstractGeometryType">
  187. <sequence minOccurs="0">
  188. <element name="outerBoundaryIs">
  189. <complexType>
  190. <sequence>
  191. <element ref="gml:LinearRing"/>
  192. </sequence>
  193. </complexType>
  194. </element>
  195. <element name="innerBoundaryIs" minOccurs="0" maxOccurs="unbounded">
  196. <complexType>
  197. <sequence>
  198. <element ref="gml:LinearRing"/>
  199. </sequence>
  200. </complexType>
  201. </element>
  202. </sequence>
  203. </extension>
  204. </complexContent>
  205. </complexType>
  206. <!-- ==============================================================
  207. aggregate geometry types
  208. =================================================================== -->
  209. <complexType name="GeometryCollectionType">
  210. <annotation>
  211. <documentation>
  212. A geometry collection must include one or more geometries, referenced
  213. through geometryMember elements. User-defined geometry collections
  214. that accept GML geometry classes as members must instantiate--or
  215. derive from--this type.
  216. </documentation>
  217. </annotation>
  218. <complexContent>
  219. <extension base="gml:AbstractGeometryCollectionBaseType">
  220. <sequence minOccurs="0">
  221. <element ref="gml:geometryMember" maxOccurs="unbounded"/>
  222. </sequence>
  223. </extension>
  224. </complexContent>
  225. </complexType>
  226. <complexType name="MultiPointType">
  227. <annotation>
  228. <documentation>
  229. A MultiPoint is defined by one or more Points, referenced through
  230. pointMember elements.
  231. </documentation>
  232. </annotation>
  233. <complexContent>
  234. <restriction base="gml:GeometryCollectionType">
  235. <sequence minOccurs="0">
  236. <element name="pointMember" maxOccurs="unbounded">
  237. <complexType>
  238. <sequence>
  239. <element ref="gml:Point"/>
  240. </sequence>
  241. </complexType>
  242. </element>
  243. </sequence>
  244. </restriction>
  245. </complexContent>
  246. </complexType>
  247. <complexType name="MultiLineStringType">
  248. <annotation>
  249. <documentation>
  250. A MultiLineString is defined by one or more LineStrings, referenced
  251. through lineStringMember elements.
  252. </documentation>
  253. </annotation>
  254. <complexContent>
  255. <restriction base="gml:GeometryCollectionType">
  256. <sequence minOccurs="0">
  257. <element name="lineStringMember" maxOccurs="unbounded">
  258. <complexType>
  259. <sequence>
  260. <element ref="gml:LineString"/>
  261. </sequence>
  262. </complexType>
  263. </element>
  264. </sequence>
  265. </restriction>
  266. </complexContent>
  267. </complexType>
  268. <complexType name="MultiPolygonType">
  269. <annotation>
  270. <documentation>
  271. A MultiPolygon is defined by one or more Polygons, referenced through
  272. polygonMember elements.
  273. </documentation>
  274. </annotation>
  275. <complexContent>
  276. <restriction base="gml:GeometryCollectionType">
  277. <sequence minOccurs="0">
  278. <element name="polygonMember" maxOccurs="unbounded">
  279. <complexType>
  280. <sequence>
  281. <element ref="gml:Polygon"/>
  282. </sequence>
  283. </complexType>
  284. </element>
  285. </sequence>
  286. </restriction>
  287. </complexContent>
  288. </complexType>
  289. <!-- ==============================================================
  290. There are two ways to represent coordinates: (1) as a sequence
  291. of <coord> elements that encapsulate tuples, or (2) using a
  292. single <coordinates> string.
  293. =================================================================== -->
  294. <complexType name="CoordType">
  295. <annotation>
  296. <documentation>
  297. Represents a coordinate tuple in one, two, or three dimensions.
  298. </documentation>
  299. </annotation>
  300. <sequence>
  301. <element name="X" type="decimal"/>
  302. <element name="Y" type="decimal" minOccurs="0"/>
  303. <element name="Z" type="decimal" minOccurs="0"/>
  304. </sequence>
  305. </complexType>
  306. <complexType name="CoordinatesType">
  307. <annotation>
  308. <documentation>
  309. Coordinates can be included in a single string, but there is no
  310. facility for validating string content. The value of the 'cs' attribute
  311. is the separator for coordinate values, and the value of the 'ts'
  312. attribute gives the tuple separator (a single space by default); the
  313. default values may be changed to reflect local usage.
  314. </documentation>
  315. </annotation>
  316. <simpleContent>
  317. <extension base="string">
  318. <attribute name="decimal" type="string" use="optional" default="."/>
  319. <attribute name="cs" type="string" use="optional" default=","/>
  320. <attribute name="ts" type="string" use="optional" default="&#x20;"/>
  321. </extension>
  322. </simpleContent>
  323. </complexType>
  324. </schema>