<?xml version="1.0" encoding="UTF-8"?>
<!-- topografix.xsd version 0.2: Private GPX extensions used by TopoGrafix products -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gpx="http://www.topografix.com/GPX/1/0" xmlns="http://www.topografix.com/GPX/Private/TopoGrafix/0/2" targetNamespace="http://www.topografix.com/GPX/Private/TopoGrafix/0/2" elementFormDefault="qualified">
<xsd:import namespace="http://www.topografix.com/GPX/1/0" schemaLocation="http://www.topografix.com/GPX/1/0/gpx.xsd"/>

<!-- Active Point definition -->

  <xsd:element name="active_point">
    <xsd:complexType>
      <xsd:attribute name="lat" type="gpx:latitudeType" use="required"/>
      <xsd:attribute name="lon" type="gpx:longitudeType" use="required"/>
    </xsd:complexType>
  </xsd:element>

<!-- Route Number definition -->
  <xsd:element name="route_number" type="xsd:decimal"/>

<!-- Route Color definition -->
  <xsd:element name="color" type="xsd:hexBinary"/>

<!-- Route Type definition -->
  <xsd:element name="type" type="xsd:string"/>

<!-- Leg definition -->
	<xsd:element name="leg">
	  <xsd:complexType>
		<xsd:sequence>	<!-- elements must appear in this order -->
		  <xsd:element name="name" type="xsd:string" minOccurs="0"/>
		  <xsd:element name="desc" type="xsd:string" minOccurs="0"/>
		  <xsd:element name="url" type="xsd:anyURI" minOccurs="0"/>
		  <xsd:element name="urlname" type="xsd:string" minOccurs="0"/>
		</xsd:sequence>
	  </xsd:complexType>
	</xsd:element>

<!-- Map definition: scanned map definition, with optional calibration info -->
	<xsd:element name="map">
	  <xsd:complexType>
		<xsd:sequence>	<!-- elements must appear in this order -->
		  <xsd:element name="name" type="xsd:string" minOccurs="0"/>
		  <xsd:element name="width" type="xsd:integer" minOccurs="0"/>
		  <xsd:element name="height" type="xsd:integer" minOccurs="0"/>
          <xsd:element name="mappt" type="mapptType" minOccurs="0" maxOccurs="unbounded"/>
          <xsd:element name="forward" type="projType" minOccurs="0"/>
          <xsd:element name="inverse" type="projType" minOccurs="0"/>
		</xsd:sequence>
      <xsd:attribute name="url" type="xsd:anyURI" use="required"/>
	  </xsd:complexType>
	</xsd:element>

<!-- Helper types -->

<!-- Mappt definition: calibration point for map - provides a lat/lon position for a point on the map -->
  <xsd:complexType name="mapptType">
    <xsd:attribute name="lat" type="gpx:latitudeType" use="required"/>
    <xsd:attribute name="lon" type="gpx:longitudeType" use="required"/>
    <xsd:attribute name="x" type="xsd:decimal" use="required"/>
    <xsd:attribute name="y" type="xsd:decimal" use="required"/>
  </xsd:complexType>

<!-- ProjType definition: map projection -->
  <xsd:complexType name="projType">
    <xsd:attribute name="a" type="xsd:decimal" use="required"/>
    <xsd:attribute name="b" type="xsd:decimal" use="required"/>
    <xsd:attribute name="c" type="xsd:decimal" use="required"/>
    <xsd:attribute name="d" type="xsd:decimal" use="required"/>
    <xsd:attribute name="e" type="xsd:decimal" use="required"/>
    <xsd:attribute name="f" type="xsd:decimal" use="required"/>
  </xsd:complexType>

</xsd:schema>