<?xml version="1.0" encoding="UTF-8"?>
<schema targetNamespace="https://repository.gdi-de.org/schemas/de.mv.land.gdi.lung/gmlcov/1.0"
  xmlns:gmlcovinsp ="https://repository.gdi-de.org/schemas/de.mv.land.gdi.lung/gmlcov/1.0"
  xmlns:gmlcov="http://www.opengis.net/gmlcov/1.0"
  xmlns:gml="http://www.opengis.net/gml/3.2"
  xmlns:somd="http://inspire.ec.europa.eu/schemas/somd/4.0"
  xmlns="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="qualified" version="1.0.3">
  <annotation>
    <appinfo>
      coverageInspireSoilMetadata.xsd
    </appinfo>
    <documentation>
      A Coverage Implementation Schema for INSPIRE based on the original OGC
      schema at https://schemas.opengis.net/gmlcov/1.0/coverage.xsd. Makes
      use of the Metadata Extension to import INSPIRE Metadata (imd);
      here: SoilMetadata.xsd.
      
      Consent was given by OGC to make modifications to the original schema.
      
      Last updated: 2023-Sep-28 
      Copyright (c) 2023 Guido Schwichtenberg (guido dot schwichtenberg at 
      lung dot mv-regierung dot de).
      
      Original OGC Document Notice: 
      Component of GML 3.2.1 Application Schema for Coverages. 
      Last updated: 2012-Jul-10 
      Copyright (c) 2012 Open Geospatial Consortium. 
      To obtain additional rights of use, visit http://www.opengeospatial.org/legal/. 
    </documentation>
  </annotation>
  <!-- ============================= -->
  <!-- Includes and imports          -->
  <!-- ============================= -->
  <import namespace="http://www.opengis.net/gml/3.2" schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
  <import namespace="http://www.opengis.net/gmlcov/1.0" schemaLocation="http://schemas.opengis.net/gmlcov/1.0/gmlcovAll.xsd"/>
  <import namespace="http://inspire.ec.europa.eu/schemas/somd/4.0" schemaLocation="https://repository.gdi-de.org/schemas/de.mv.land.gdi.lung/somd/4.0/SoilMetadata.xsd"/>

  <!-- ============================= -->
  <!-- Body of this schema           -->
  <!-- ============================= -->
  <element name="AbstractCoverage" type="gmlcovinsp:AbstractCoverageType" abstract="true" substitutionGroup="gml:AbstractFeature">
    <annotation>
      <documentation>Like its role model gml:AbstractCoverageType in GML 3.2.1, this element serves as the head of a substitution group which may contain any coverage whose type is derived, however, from gmlcovinsp:AbstractCoverageType [OGC original: gmlcov:AbstractCoverageType] (rather than gml:AbstractCoverageType).  It may act as a variable in the definition of content models where it is required to permit any coverage to be valid.</documentation>
    </annotation>
  </element>
  <complexType name="AbstractCoverageType">
    <annotation>
      <documentation>The gml:coverageFunction property is shifted "up" to this place in the inheritance hierarchy because it is included in both discrete and continuous coverages (i.e., all subtypes of AbstractCoverageType) and, hence, does not change syntax nor semantic in any way. It permits, however, coverages in the gmlcovinsp:AbstractCoverage [OGC original: gmlcov:AbstractCoverage] substitutionGroup to be used for either discrete and continuous coverages, in preparation for expected future elimination of this distinction. </documentation>
    </annotation>
    <complexContent>
      <extension base="gml:AbstractCoverageType">
        <sequence>
          <element ref="gml:coverageFunction" minOccurs="0"/>
          <element ref="gmlcov:rangeType"/>
          <element ref="gmlcovinsp:metadata" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ============================================================= -->
  <element name="metadata">
    <annotation>
      <documentation>This is a hook for adding any further information to a coverage, such as domain-specific metadata. Recommended use is to use the XML extension mechanism, such as in a WCS extension or Application Profile, to define the desired metadata structure.</documentation>
    </annotation>
    <complexType>
      <complexContent>
        <extension base="gml:AbstractMetadataPropertyType">
          <sequence>
            <element ref="gmlcovinsp:Extension" minOccurs="0"/>
          </sequence>
          <attributeGroup ref="gml:AssociationAttributeGroup"/>
        </extension>
      </complexContent>
    </complexType>
  </element>
  <!-- =========================================================== -->
  <element name="Extension" type="gmlcovinsp:ExtensionType">
    <annotation>
      <documentation>Extension element used to hook in additional content e.g. in extensions or application profiles.</documentation>
    </annotation>
  </element>
  <complexType name="ExtensionType">
    <complexContent>
      <extension base="gml:AbstractMetadataPropertyType">
        <sequence>
          <!-- Reference to the Metadata Extension -->
          <element ref="somd:SoilThemeCoverageMD" minOccurs="1" maxOccurs="unbounded"/>
          <element ref="somd:SoilThemeDescriptiveCoverageMD" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ============================================================= -->
  <complexType name="AbstractDiscreteCoverageType">
    <annotation>
      <documentation>This parallels gml:DiscreteCoverageType, except that the gml:coverageFunction element has been moved "up" into gmlcovinsp:AbstractCoverageType [OGC original: gmlcov:AbstractCoverageType]. Its name has been adjusted following the rule defined in GML 3.2.1 Subclause F.2.1.2.2.</documentation>
    </annotation>
    <complexContent>
      <extension base="gmlcovinsp:AbstractCoverageType">
        <sequence>
        </sequence>
      </extension>
    </complexContent>
  </complexType>
  <!-- ============================================================= -->
  <element name="RectifiedGridCoverage" type="gmlcovinsp:AbstractDiscreteCoverageType" abstract="true" substitutionGroup="gmlcovinsp:AbstractCoverage">
    <annotation>
      <documentation>A RectifiedGridCoverage is a discrete point coverage based on a rectified grid. It is similar to the grid coverage except that the points of the grid are geometrically referenced. The rectified grid coverage has a domain that is a gml:RectifiedGrid geometry. </documentation>
      <documentation>Since this RectifiedGridCoverage uses the gmlcovinsp:AbstractCoverageType [OGC original: gmlcov:AbstractCoverageType], it can be used for both discrete and continuous coverages. </documentation>
    </annotation>
  </element>
</schema>
