<?xml version="1.0"?>
<xsd:schema targetNamespace="http://www.expeditionmarine.com/xmlschemas"
  elementFormDefault="qualified"
  xmlns="http://www.expeditionmarine.com/xmlschemas"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <xsd:annotation>
    <xsd:documentation>
      This schema defines the Expedition extensions to be used with the GPX 1.1 schema.
      The root elements defined by this schema are intended to be used as child
      elements of the "extensions" elements in the GPX 1.1 schema. The GPX 1.1
      schema is available at http://www.topografix.com/GPX/1/1/gpx.xsd
    </xsd:documentation>
  </xsd:annotation>

  <xsd:element name="WaypointExtension" type="WaypointExtension_t" />

  <xsd:element name="RouteExtension" type="RouteExtension_t" />
  
  <xsd:element name="RoutePointExtension" type="RoutePointExtension_t" />

  <xsd:complexType name="WaypointExtension_t">
    <xsd:annotation><xsd:documentation>
    This type contains data fields available in Expedition waypoints that cannot be represented in waypoints in GPX 1.1 instances.
    </xsd:documentation></xsd:annotation>
    <xsd:sequence>
      <!-- Mark fields -->
      <xsd:element name="id" type="xsd:decimal" minOccurs="0" />
      <xsd:element name="rangecircle" type="xsd:double" minOccurs="0" />
      <xsd:element name="icon" type="xsd:decimal" />
      <xsd:element name="mob" type="xsd:boolean" />
      <xsd:element name="lock" type="xsd:boolean" />
      <xsd:element name="alwaysdraw" type="xsd:boolean" />
      <!-- Misc -->
      <xsd:element name="role" type="xsd:string" />
      <xsd:element name="tws" type="xsd:double" />
      <xsd:element name="twd" type="xsd:double" />
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="RouteExtension_t">
        <xsd:annotation><xsd:documentation>
        This type contains data fields available in Expedition routes that cannot be represented in routes in GPX 1.1 instances.
        </xsd:documentation></xsd:annotation>
        <xsd:sequence>
            <!-- Route fields -->
            <xsd:element name="id" type="xsd:decimal" minOccurs="0" />
            <xsd:element name="loop" type="xsd:boolean" />
            <!-- Optimised route fields -->
			<xsd:element name="runtime" type="xsd:dateTime" />
			<xsd:element name="model" type="xsd:string" />
			<xsd:element name="model_current" type="xsd:string" />
            <xsd:element name="polar" type="xsd:string" />
            <xsd:element name="type" type="xsd:string" />
            <xsd:element name="elapsedtime" type="xsd:string" />
            <xsd:element name="polpc_day" type="xsd:double" />
            <xsd:element name="polpc_night" type="xsd:double" />
	        <xsd:element name="windpc" type="xsd:double" />
	        <xsd:element name="currentpc" type="xsd:double" />
			<xsd:element name="airdensityweight" type="xsd:double" />
			<xsd:element name="motor" type="xsd:boolean" />
			<xsd:element name="waves" type="xsd:boolean" />
        </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="RoutePointExtension_t">
    <xsd:annotation><xsd:documentation>
    This type contains data fields available in Expedition routes that cannot be represented in routes in GPX 1.1 instances.
    All bearings in degrees true.
    </xsd:documentation></xsd:annotation>
    <xsd:sequence>
      <!-- Mark fields -->
      <xsd:element name="idmark" type="xsd:decimal" />
      <xsd:element name="idgate" type="xsd:decimal" />
      <xsd:element name="pass" type="xsd:decimal" minOccurs="0" />
      <xsd:element name="skip" type="xsd:boolean" />
      <!-- Optimised route fields -->
      <xsd:element name="tws" type="xsd:double" />
      <xsd:element name="twd" type="xsd:double" />
      <xsd:element name="twa" type="xsd:double" />
      <xsd:element name="bsp" type="xsd:double" />
      <xsd:element name="targtwa" type="xsd:double" />
      <xsd:element name="set" type="xsd:double" />
      <xsd:element name="drift" type="xsd:double" />
      <xsd:element name="sigheight" type="xsd:double" />
      <xsd:element name="sail" type="xsd:string" />
      <xsd:element name="brg" type="xsd:double" />
      <xsd:element name="rng" type="xsd:double" />
      <xsd:element name="mslp" type="xsd:double" />
      <xsd:element name="rain" type="xsd:double" />
      <xsd:element name="airtemp" type="xsd:double" />
      <xsd:element name="seatemp" type="xsd:double" />
      <xsd:element name="motor" type="xsd:boolean" />
    </xsd:sequence>
  </xsd:complexType>

</xsd:schema>
