<?xml version="1.0" encoding="utf-8"?>
<!-- edited with XMLSpy v2005 rel. 3 U (http://www.altova.com) by gudmund (Norut IT) -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:ais="http://cweb.ksat.no/cweb/schema/ais" targetNamespace="http://cweb.ksat.no/cweb/schema/ais" elementFormDefault="qualified" attributeFormDefault="unqualified" version="3.1.1" id="ais">
	<xsd:annotation>
		<xsd:documentation>
		    Copyright (c) 2005 Norut IT, All Rights Reserved.
			AIS based vehicle tracking - GML Application schema
		</xsd:documentation>
	</xsd:annotation>
	<!-- ====================================================================== -->
	<!-- GML IMPORT -->
	<xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://cweb.ksat.no/cweb/schema/gml/3.1.1/base/feature.xsd"/>
	<xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://cweb.ksat.no/cweb/schema/gml/3.1.1/base/geometryAggregates.xsd"/>
	<!-- ================================================================== -->
	<!-- globally defined ais: elements (direct from gml or xsd namespace types) -->
	<xsd:element name="time" type="xsd:dateTime">
		<xsd:annotation>
			<xsd:documentation>Allways in UTC timeframe (YYYY-MM-DDThh:mm:ss)</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="MMSI" type="xsd:string">
		<xsd:annotation>
			<xsd:documentation>Vessel Identification according to the IMO AIS standards</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="expectedTimeOfArrival" type="xsd:dateTime">
		<xsd:annotation>
			<xsd:documentation>Allways in UTC timeframe (YYYY-MM-DDThh:mm:ss)</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="length" type="xsd:decimal">
		<xsd:annotation>
			<xsd:documentation>In meters</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="beam" type="xsd:decimal">
		<xsd:annotation>
			<xsd:documentation>In meters</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="draught" type="xsd:decimal">
		<xsd:annotation>
			<xsd:documentation>In meters</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="courseOverGround" type="xsd:decimal">
		<xsd:annotation>
			<xsd:documentation>In decimal deegrees of angle</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="heading" type="xsd:decimal">
		<xsd:annotation>
			<xsd:documentation>In decimal deegrees of angle</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="bearing" type="xsd:decimal">
		<xsd:annotation>
			<xsd:documentation>In decimal deegrees of angle</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="speedOverGround" type="xsd:decimal">
		<xsd:annotation>
			<xsd:documentation>In knots</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="rateOfTurn" type="xsd:decimal">
		<xsd:annotation>
			<xsd:documentation>Units as defined for IMO AIS ?</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="navigationalStatus" type="xsd:string">
		<xsd:annotation>
			<xsd:documentation>Free text</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:element name="dataSource" type="xsd:string">
		<xsd:annotation>
			<xsd:documentation>Organizational source of data for the object of which this element is a member, used at several levels and may represent a data service provider, a data management sys., an AIS transmission sys., etc.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<!-- ================================================================== -->
	<!-- ais: moving object status element - based on a gml Point -->
	<xsd:element name="objectStatus" type="ais:ObjectStatusType" substitutionGroup="gml:pointProperty">
		<xsd:annotation>
			<xsd:documentation>Inherits the pointMemberType of gml.  This 'time slice' type encapsulates the various dynamic properties of AIS objects at a given point in time and space</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="ObjectStatusType">
		<xsd:complexContent>
			<xsd:extension base="gml:PointPropertyType">
				<xsd:sequence>
					<xsd:element ref="ais:time">
						<xsd:annotation>
							<xsd:documentation>Time represents here the AIS message time stamp (mandatory)</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:speedOverGround" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>SOG as defined for AIS messages (optional)</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:courseOverGround" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>COG as defined for AIS messages (optional)</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:heading" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Heading as defined for AIS messages (optional)</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:bearing" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Bearing, not currently defined for AIS messages (optional)</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:rateOfTurn" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Rate Of Turn as defined for AIS messages (optional)</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:navigationalStatus" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Status free text as defined for AIS messages (optional)</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="safetyMessage" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:dataSource" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>dataSource (optional) represents here the infrastructure supplying the AIS message</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<!-- ================================================================== -->
	<!-- the AIS Track type - parallel to gml: multi point -->
	<xsd:element name="track" type="ais:TrackType" substitutionGroup="gml:_GeometricAggregate">
		<xsd:annotation>
			<xsd:documentation>The track of an object is a sequence of specialized timeslices (i.e. ObjectStatus) that indicate the dynamic status of the object.  Inherits srsName attribute of abstract geometry type for defining SRS for this entire track, i.e. all geometry elements within this track are interpreted under the given SRS, unless differently specified at a lower level for each geometric element.</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="TrackType">
		<xsd:complexContent>
			<xsd:extension base="gml:AbstractGeometricAggregateType">
				<xsd:sequence>
					<xsd:element ref="ais:objectStatus" minOccurs="0" maxOccurs="unbounded"/>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<!-- ================================================================== -->
	<!-- the AIS Track Property type - every feature should have a geometry property -->
	<xsd:element name="trackProperty" type="ais:TrackPropertyType">
		<xsd:annotation>
			<xsd:documentation>This is applied as the geometry property of a feature, so that general GML tools can interpret that each feature is associated with a given geometry - NB! it contains no attribute group refering to gml:AssociationAttributeGroup</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="TrackPropertyType">
		<xsd:sequence minOccurs="0">
			<xsd:element ref="ais:track"/>
		</xsd:sequence>
	</xsd:complexType>
	<!-- ================================================================== -->
	<!-- AIS Feature Type -->
	<xsd:element name="feature" type="ais:FeatureType" substitutionGroup="gml:_Feature">
		<xsd:annotation>
			<xsd:documentation>An AIS feature encloses static, voyage-related, and dynamic/historic info of a single AIS object (typically a response to time and geometry bounded request for tracking-data of an identifyable vehicle)</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<xsd:complexType name="FeatureType">
		<xsd:complexContent>
			<xsd:extension base="gml:AbstractFeatureType">
				<xsd:sequence>
					<!-- mandatory static AIS properties -->
					<xsd:element ref="ais:MMSI">
						<xsd:annotation>
							<xsd:documentation>mandatory</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="callsign" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>mandatory</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="name" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>mandatory</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<!-- optional static AIS properties -->
					<xsd:element name="IMONumber" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:length" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:beam" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="vesselType" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="antennaLocation" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<!-- optional voyage related AIS properties-->
					<xsd:element ref="ais:draught" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="hazardousCargo" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="destination" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:expectedTimeOfArrival" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="extraInfo" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<!-- optional dynamic AIS properties - i.e. the track info -->
					<xsd:element ref="ais:trackProperty" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>optional</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<!-- optional origin of feature properties -->
					<xsd:element ref="ais:time" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Time (optional) represents here the time of creation of this feature as a "snapshot" of history, which implies the latest possible time of an AISObjectStatus within the feature.	Should be identical to - and omitted here - given the enclosing feature collection's time</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:dataSource" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>dataSource (optional)  represents here the generating organizational source for this feature, e.g. coastal traffic authorities collecting AIS messages from a fleet. Should be identical to - and omitted here - given the enclosing feature collection's dataSource</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<!-- =================================================== -->
	<!-- =================================================== -->
	<!-- The Request element for a AIS Feature Service                           -->
	<!-- =================================================== -->
	<!-- =================================================== -->
	<xsd:element name="getFeature" type="ais:GetFeatureType">
		<xsd:annotation>
			<xsd:documentation>This is the concrete request element used to query a service for AIS features</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<!-- the GetAISFeature request element type -->
	<xsd:complexType name="GetFeatureType">
		<xsd:annotation>
			<xsd:documentation>Extends the Bounding Box type of gml, giving the geometric boundaries for the requested AIS Features.  The object status reports included in the track of each AISFeature must have position within the bounding box, AND have time value that lies within the time period specified by the 'to'/'from' elements.  However, the requesting part can specify the 'requireLastPos' with value' true' to indicate that the temporally "last known position" object status should be included in each features track</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="gml:EnvelopeType">
				<xsd:sequence>
					<xsd:element name="from" type="xsd:dateTime">
						<xsd:annotation>
							<xsd:documentation>(mandatory) The starting time period endpoint</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="to" type="xsd:dateTime" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>(optional) The ending time period endpoint, if not present the time period should be interpreted as ending "now", i.e. the current timepoint as the request is processed</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="requestID" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>If a requestID is given here, it shall be set as the value of the 'requestID' element of the AISFeatureCollection returned as the response to this request</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="requireLastPos" type="xsd:boolean" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>If set to 'true', the requesting part requires each AISFeature's temporally last (within the specified time period) AISObjectStatus to be included in it's AISTrack, even though the geometric position may fall outside the specified geometry of the envelope</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="temporalResolutionSec" type="xsd:int" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Indicates, in number of seconds, the appropriate temporal resolution for the AISTracs of the response.  If objects are positioned by a positoning service every 10 seconds, a value of 120 given here by the requesting part, would mean that only every 12th position is included in the track - i.e. one AISObjectStatus for every 2 minutes</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:MMSI" minOccurs="0" maxOccurs="unbounded">
						<xsd:annotation>
							<xsd:documentation>If given, this is regarded as a criteria for the query, such that only a feature with this MMSI is included in the response</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
	<!-- =================================================== -->
	<!-- =================================================== -->
	<!-- The Response element for a AIS Feature Service                        -->
	<!-- =================================================== -->
	<!-- =================================================== -->
	<xsd:element name="featureCollection" type="ais:FeatureCollectionType" substitutionGroup="gml:_FeatureCollection">
		<xsd:annotation>
			<xsd:documentation>This is the concrete response element used to query a service for AIS features</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	<!-- AIS  Feature Collection Type -->
	<xsd:complexType name="FeatureCollectionType">
		<xsd:annotation>
			<xsd:documentation>
				An AIS feature collection encloses a set of AIS features - usually as a response 
				to a request/query that is bounded in time and geometry.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="gml:AbstractFeatureCollectionType">
				<xsd:sequence>
					<xsd:element name="requestID" type="xsd:string" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>If an requestID was given by the requesting part, it's value shall be set here</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<!-- optional origin of feature collection properties -->
					<xsd:element ref="ais:time" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>Time (optional)  represents here the time of creation of this feature collection as a "snapshot" of history, which allso implies the latest possible time of an ObjectStatus within the collection</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element ref="ais:dataSource" minOccurs="0">
						<xsd:annotation>
							<xsd:documentation>DataSource (optional)  represents here the generating organizational source for this feature collection, e.g. coastal traffic authorities collecting AIS messages from a fleet</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>
</xsd:schema>

