<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:gml="http://www.opengis.net/gml"
        targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema"
        elementFormDefault="qualified" version="3.2.0">
  <annotation>
    <appinfo source="urn:ogc:specification:gml:schema-xsd:grids:3.2.0">grids.xsd</appinfo>
    <documentation>See ISO/DIS 19136 20.2.
      An implicit description of geometry is one in which the items of the geometry do not
      explicitly appear in the encoding. Instead, a compact notation records a set of parameters,
      and a set of objects may be generated using a rule with these parameters. This Clause provides
      grid geometries that are used in the description of gridded coverages and other applications.
      In GML two grid structures are defined, namely gml:Grid and gml:RectifiedGrid.
    </documentation>
  </annotation>
  <include schemaLocation="geometryBasic0d1d.xsd"/>
  <element name="Grid" type="gml:GridType" substitutionGroup="gml:AbstractImplicitGeometry">
    <annotation>
      <documentation>The gml:Grid implicitly defines an unrectified grid, which is a network
        composed of two or more sets of curves in which the members of each set intersect the
        members of the other sets in an algorithmic way. The region of interest within the grid is
        given in terms of its gml:limits, being the grid coordinates of diagonally opposed corners
        of a rectangular region. gml:axisLabels is provided with a list of labels of the axes of the
        grid (gml:axisName has been deprecated). gml:dimension specifies the dimension of the grid.
        The gml:limits element contains a single gml:GridEnvelope. The gml:low and gml:high property
        elements of the envelope are each integerLists, which are coordinate tuples, the coordinates
        being measured as offsets from the origin of the grid along each axis, of the diagonally
        opposing corners of a “rectangular” region of interest.
      </documentation>
    </annotation>
  </element>
  <element name="AbstractImplicitGeometry" type="gml:AbstractGeometryType" abstract="true"
           substitutionGroup="gml:AbstractGeometry"/>
  <complexType name="GridType">
    <complexContent>
      <extension base="gml:AbstractGeometryType">
        <sequence>
          <element name="limits" type="gml:GridLimitsType"/>
          <choice>
            <element name="axisLabels" type="gml:NCNameList"/>
            <element name="axisName" type="string" maxOccurs="unbounded"/>
          </choice>
        </sequence>
        <attribute name="dimension" type="positiveInteger" use="required"/>
      </extension>
    </complexContent>
  </complexType>
  <complexType name="GridLimitsType">
    <sequence>
      <element name="GridEnvelope" type="gml:GridEnvelopeType"/>
    </sequence>
  </complexType>
  <complexType name="GridEnvelopeType">
    <sequence>
      <element name="low" type="gml:integerList"/>
      <element name="high" type="gml:integerList"/>
    </sequence>
  </complexType>
  <element name="RectifiedGrid" type="gml:RectifiedGridType" substitutionGroup="gml:Grid">
    <annotation>
      <documentation>A rectified grid is a grid for which there is an affine transformation between
        the grid coordinates and the coordinates of an external coordinate reference system. It is
        defined by specifying the position (in some geometric space) of the grid “origin” and of the
        vectors that specify the post locations.
        Note that the grid limits (post indexes) and axis name properties are inherited from
        gml:GridType and that gml:RectifiedGrid adds a gml:origin property (contains or references a
        gml:Point) and a set of gml:offsetVector properties.
      </documentation>
    </annotation>
  </element>
  <complexType name="RectifiedGridType">
    <complexContent>
      <extension base="gml:GridType">
        <sequence>
          <element name="origin" type="gml:PointPropertyType"/>
          <element name="offsetVector" type="gml:VectorType" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
</schema>
