geometry.xsd 14 KB

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