<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://earth.google.com/kml/2.1"
  targetNamespace="http://earth.google.com/kml/2.1" elementFormDefault="qualified">
  <xsd:include schemaLocation="http://code.google.com/apis/kml/schema/kml21.xsd" />
  <xsd:include schemaLocation="http://carocoops.org/obskml/1.0.0/obs_types.xsd" />
  <xsd:include schemaLocation="http://carocoops.org/obskml/1.0.0/uom_types.xsd" />
  <xsd:redefine schemaLocation="http://code.google.com/apis/kml/schema/kml21.xsd">
    <xsd:complexType name="MetadataType">
      <xsd:complexContent>
        <xsd:restriction base="MetadataType">
          <xsd:sequence>
            <xsd:element name="obsList">
              <xsd:complexType>
                <xsd:sequence>
                  <xsd:element name="obs" type="obs" maxOccurs="unbounded" />
                </xsd:sequence>
              </xsd:complexType>
            </xsd:element>
          </xsd:sequence>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
  </xsd:redefine>

  <!-- 
The 'elev' tag in the schema corresponds to elevation. Positive is meters above sea level and negative is meters below sea level.

A recommended but not required convention is to use the Placemark id attribute to help uniquely identify observations between data providers. The recommended convention is the concatenation of <operator>.<platform>.<package> like carocoops.CAP1.buoy or nws.KCAE.met

Observation listing order is preferred to be from highest elevation/altitude to lowest elevation/depth.

Redundant sensors/observations would be listed in their order of importance (primary, secondary, etc). 
  -->

  <xsd:complexType name="obs">
    <xsd:sequence>
      <xsd:element name="obsType" type="obsType" />
      <xsd:element name="uomType" type="uomType" />
      <xsd:element name="value" type="xsd:decimal" />
      <xsd:element name="elev" type="xsd:decimal" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>
