<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns:raster="http://www.deegree.org/datasource/coverage/raster" xmlns="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.deegree.org/datasource/coverage/raster" elementFormDefault="qualified"
  xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" jaxb:version="3.0">
  <annotation>
    <appinfo>
      <jaxb:schemaBindings>
        <jaxb:package name="org.deegree.coverage.raster.io.jaxb" />
      </jaxb:schemaBindings>
    </appinfo>
  </annotation>

  <element name="Raster">
    <annotation>
      <appinfo>
        <jaxb:class name="RasterConfig" />
      </appinfo>
    </annotation>
    <complexType>
      <complexContent>
        <extension base="raster:AbstractRasterType">
          <attribute name="configVersion" type="string" use="optional"/>
        </extension>
      </complexContent>
    </complexType>
  </element>

  <element name="MultiResolutionRaster">
    <annotation>
      <documentation>A multi resolution raster wraps (single) rasters and adds a resolution of each raster.
      </documentation>
      <appinfo>
        <jaxb:class name="MultiResolutionRasterConfig" />
      </appinfo>
    </annotation>
    <complexType>
      <sequence>
        <element name="StorageCRS" minOccurs="0" type="string" />
        <element name="Resolution" maxOccurs="unbounded">
          <complexType>
            <complexContent>
              <extension base="raster:AbstractRasterType">
                <attribute name="res" type="double" />
              </extension>
            </complexContent>
          </complexType>
        </element>
      </sequence>
      <attribute name="originLocation" default="center" type="raster:OriginLocation" />
      <attribute name="readWorldFiles" default="true" type="boolean" />
      <attribute name="nodata" type="decimal" />
      <attribute name="configVersion" type="string" use="optional"/>
    </complexType>
  </element>

  <complexType name="AbstractRasterType" abstract="true">
    <sequence>
      <element name="StorageCRS" minOccurs="0" type="string" />
      <choice minOccurs="0">
        <element name="RasterFile">
          <complexType>
            <simpleContent>
              <extension base="string">
                <attribute name="imageIndex" type="int" use="optional" />
              </extension>
            </simpleContent>
          </complexType>
        </element>
        <element name="RasterDirectory">
          <complexType>
            <simpleContent>
              <extension base="string">
                <attribute name="recursive" type="boolean" default="false" />
              </extension>
            </simpleContent>
          </complexType>
        </element>
      </choice>
    </sequence>
    <attribute name="readWorldFiles" default="true" type="boolean" />
    <attribute name="originLocation" default="center" type="raster:OriginLocation" />
    <attribute name="nodata" type="decimal" />
  </complexType>

  <simpleType name="OriginLocation">
    <restriction base="string">
      <enumeration value="center" />
      <enumeration value="outer" />
    </restriction>
  </simpleType>

</schema>
