<?xml version="1.0" encoding="UTF-8"?>
<schema
  targetNamespace="https://schemas.isotc211.org/schemas/19123/-2/cis/1.2"
  xmlns:cis="https://schemas.isotc211.org/schemas/19123/-2/cis/1.2"
  xmlns:swe="http://www.opengis.net/swe/2.0"
  xmlns:gml="http://www.opengis.net/gml/3.2"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xmlns="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified"
  version="1.2.0">

  <annotation>
    <appinfo>coverage.xsd</appinfo>
    <documentation>
      This is the XML Schema for ISO 19123-2:2026 Geographic information - Part 2: Coverage implementation schema.
      This work is derived from the OGC Coverage Implementation Schema 1.1.1 (OGC 09-146r8),
      it includes modifications for alignment with ISO/TC 211 standards and URI structures.
      Last updated: 2026-04-01

      Copyright (c) 2026 ISO/TC 211. All rights reserved.

      OGC Coverage Implementation Schema 1.1.1 (OGC 09-146r8) is copyright (c) 2012, 2015, 2017, 2019 Open Geospatial Consortium.
      Used by ISO/TC211 with permission from OGC.
      To obtain additional rights of use from OGC, visit http://www.opengeospatial.org/legal/.
    </documentation>
  </annotation>

  <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="https://schemas.isotc211.org/schemas/19136/-/gml/1.0/gml.xsd"/>
  <include schemaLocation="cisAll.xsd"/>
  <import namespace="http://www.opengis.net/swe/2.0" schemaLocation="sweAll.xsd"/>

  <element name="AbstractCoverage" type="cis:AbstractCoverageType" abstract="true" substitutionGroup="gml:AbstractFeature">
    <annotation>
      <documentation>cis11:AbstractCoverage is the abstract superclass for the CIS 1.1 UML Coverage structures.</documentation>
    </annotation>
  </element>
  <complexType name="AbstractCoverageType">
    <complexContent>
      <extension base="gml:AbstractFeatureType">
        <sequence>
          <element ref="cis:CoverageFunction" minOccurs="0"/>
          <element ref="cis:Envelope" minOccurs="0"/>
          <choice>
            <sequence>
              <element ref="cis:DomainSet"/>
              <element ref="cis:RangeSet"/>
            </sequence>
            <element ref="cis:PartitionSet"/>
          </choice>
          <element ref="cis:RangeType"/>
          <element ref="cis:Metadata" minOccurs="0"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>

  <element name="CoverageFunction" type="cis:CoverageFunctionType">
    <annotation>
      <documentation>Coverage function defining mapping of coordinate to value position in grids (simplified from GML).</documentation>
    </annotation>
  </element>
  <complexType name="CoverageFunctionType">
    <sequence>
      <element name="sequenceRule" type="string" minOccurs="0"/>
      <element name="axisOrder"    type="string" minOccurs="0"/>
      <element name="startPoint"   type="string" minOccurs="0"/>
    </sequence>
  </complexType>

  <element name="Envelope" type="cis:EnvelopeByAxisType">
    <annotation>
      <documentation>The envelope around a coverage is defined by the lower and upper bound of each axis, respectively...</documentation>
    </annotation>
  </element>
  <complexType name="EnvelopeByAxisType">
    <sequence>
      <element name="AxisExtent" maxOccurs="unbounded">
        <complexType>
          <attribute name="axisLabel" type="NCName" use="required"/>
          <attribute name="uomLabel" type="string" use="required"/>
          <attribute name="lowerBound" type="anySimpleType" use="required"/>
          <attribute name="upperBound" type="anySimpleType" use="required"/>
        </complexType>
      </element>
    </sequence>
    <attribute name="srsName" type="string" use="required"/>
    <attribute name="axisLabels" type="cis:NameListType" use="required"/>
    <attribute name="srsDimension" type="positiveInteger"/>
  </complexType>

  <simpleType name="NameListType">
    <annotation>
      <documentation>A name list is an ordered sequence of whitespace-separated names...</documentation>
    </annotation>
    <list itemType="NCName"/>
  </simpleType>

  <element name="DomainSet" type="cis:DomainSetType">
    <annotation>
      <documentation>The DomainSet describes the "direct positions" of the coverage...</documentation>
    </annotation>
  </element>
  <complexType name="DomainSetType">
    <sequence>
      <choice>
        <element ref="cis:MultiPoint"/>
        <element ref="cis:GeneralGrid"/>
        <element ref="gml:MultiCurve"/>
        <element ref="gml:MultiSurface"/>
        <element ref="gml:MultiSolid"/>
      </choice>
    </sequence>
  </complexType>

  <element name="RangeType" type="cis:RangeTypeType">
    <annotation>
      <documentation>The RangeType element describes the structure and semantics of a coverage's range values...</documentation>
    </annotation>
  </element>
  <complexType name="RangeTypeType">
    <sequence>
      <element ref="swe:DataRecord"/>
      <element name="InterpolationRestriction" type="cis:InterpolationRestrictionType" minOccurs="0"/>
    </sequence>
  </complexType>
  <complexType name="InterpolationRestrictionType">
    <sequence>
      <element name="AllowedInterpolation" type="anyURI" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <element name="RangeSet" type="cis:RangeSetType">
    <annotation>
      <documentation>The RangeSet lists a value for each of the coverage's direct positions...</documentation>
    </annotation>
  </element>
  <complexType name="RangeSetType">
    <choice>
      <element name="DataBlock">
        <complexType>
          <sequence maxOccurs="unbounded">
            <choice>
              <element name="V" type="string"/>
              <element name="CV" type="cis:CompositeRangeValueType"/>
            </choice>
          </sequence>
        </complexType>
      </element>
      <element name="FileReference" type="anyURI"/>
    </choice>
  </complexType>
  <complexType name="CompositeRangeValueType">
    <annotation>
    </annotation>
    <sequence>
      <element name="V" type="string" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <element name="PartitionSet" type="cis:PartitionSetType">
    <annotation>
      <documentation>A partition describes how a coverage...</documentation>
    </annotation>
  </element>
  <complexType name="PartitionSetType">
    <choice>
      <element name="Partition" type="cis:PartitionType" maxOccurs="unbounded"/>
      <element name="PV" type="cis:PositionValuePairType" maxOccurs="unbounded"/>
    </choice>
    <attribute name="srsName" type="string"/>
    <attribute name="axisLabels" type="cis:NameListType"/>
    <attribute name="uomLabels" type="string"/>
  </complexType>
  <complexType name="PartitionType">
    <sequence>
      <element ref="cis:Envelope" minOccurs="0"/>
      <choice>
        <element ref="cis:AbstractCoverage"/>
        <element name="CoverageId" type="string"/>
        <element name="CoverageRef" type="anyURI"/>
      </choice>
    </sequence>
  </complexType>

  <complexType name="PositionValuePairType">
    <annotation>
      <documentation>Position/value pairs resemble (possibly n-D) coordinate / (possibly) composite) value pairs...</documentation>
    </annotation>
    <sequence>
      <element name="P" type="cis:DirectPositionPointType"/>
      <choice>
        <element name="V" type="string"/>
        <element name="CV" type="cis:CompositeRangeValueType"/>
      </choice>
    </sequence>
  </complexType>

  <complexType name="DirectPositionPointType">
    <annotation>
      <documentation>Direct position points resemble n-D coordinates...</documentation>
    </annotation>
    <sequence>
      <element name="C" type="string" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <element name="Metadata" type="cis:MetadataType">
    <annotation>
      <documentation>The metadata element is a container of any...</documentation>
    </annotation>
  </element>
  
  <complexType name="MetadataType">
    <sequence>
      <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
    </sequence>
  </complexType>

  <element name="GeneralGridCoverage" type="cis:GeneralGridCoverageType" substitutionGroup="cis:AbstractCoverage">
    <annotation>
      <documentation>A GeneralGridCoverage is a specialization of AbstractCoverage where the DomainSet is given by a GeneralGrid;
 its grid axes can be of different types (non-referenced, regular, irregular, algorithmic, etc.).</documentation>
    </annotation>
  </element>
  <complexType name="GeneralGridCoverageType">
    <complexContent>
      <extension base="cis:AbstractCoverageType"/>
    </complexContent>    
  </complexType>

  <element name="SensorModelCoverage" type="cis:GeneralGridCoverageType" substitutionGroup="cis:GeneralGridCoverage">
    <annotation>
      <documentation>A coverage whose domain set is given by a grid defined through a SensorML 2.0 transformation model, represented by a TransformationBySensorModel element.</documentation>
    </annotation>
  </element>

  <element name="MultiPointCoverage" type="cis:MultiPointCoverageType" substitutionGroup="cis:AbstractCoverage">
    <annotation>
      <documentation>In a MultiPointCoverage (i.e., point cloud) the DomainSet consists of a MultiPoint, i.e.: a collection of points.</documentation>
    </annotation>
  </element>
  <complexType name="MultiPointCoverageType">
    <complexContent>
      <extension base="cis:AbstractCoverageType"/>
    </complexContent>
  </complexType>
  <element name="MultiPoint" type="cis:MultiPointType">
    <annotation>
      <documentation>A MultiPoint consist of a list of arbitrary direct positions (normally 
 not aligned on a grid). By using the CIS direct position concept instead of GML, non-numerical coordinates (such as date and time stamps) are possible.</documentation>
    </annotation>
  </element>
  <complexType name="MultiPointType">
    <sequence>
      <element name="P" type="cis:DirectPositionPointType" maxOccurs="unbounded"/>
    </sequence>
    <attribute name="srsName" type="string" use="required"/>
    <attribute name="axisLabels" type="cis:NameListType" use="required"/>
    <attribute name="uomLabels" type="string" use="required"/>
  </complexType>

  <element name="MultiCurveCoverage" type="cis:MultiCurveCoverageType" substitutionGroup="cis:AbstractCoverage">
    <annotation>
      <documentation>In a MultiCurveCoverage the DomainSet consists of a MultiCurve (enforced via schematron rule).</documentation>
    </annotation>
  </element>
  <complexType name="MultiCurveCoverageType">
    <complexContent>
      <extension base="cis:AbstractCoverageType"/>
    </complexContent>
  </complexType>

  <element name="MultiSurfaceCoverage" type="cis:MultiSurfaceCoverageType" substitutionGroup="cis:AbstractCoverage">
    <annotation>
      <documentation>In a MultiSurfaceCoverage the DomainSet consists of a MultiSurface (enforced via schematron rule).</documentation>
    </annotation>
  </element>
  <complexType name="MultiSurfaceCoverageType">
    <complexContent>
      <extension base="cis:AbstractCoverageType"/>
    </complexContent>
  </complexType>

  <element name="MultiSolidCoverage" type="cis:MultiSolidCoverageType" substitutionGroup="cis:AbstractCoverage">
    <annotation>
      <documentation>In a MultiSolidCoverage the DomainSet consists of a MultiSolid (enforced via schematron rule).</documentation>
    </annotation>
  </element>
  <complexType name="MultiSolidCoverageType">
    <complexContent>
      <extension base="cis:AbstractCoverageType"/>
    </complexContent>
  </complexType>

</schema>
