<?xml version="1.0" encoding="UTF-8" ?>
<schema targetNamespace="http://www.opengis.net/gml" xmlns:gml="http://www.opengis.net/gml" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" version="3.0.1">
    <annotation>
        <appinfo source="urn:opengis:specification:gml:schema-xsd:feature:v3.0.1" />
        <documentation>
     		      GML Feature schema. 		      
     		      Copyright (c) 2001-2002 OGC, All Rights Reserved. 
	      
    </documentation>
    </annotation> <!-- ============================================================== --> <!-- ==================        includes and imports  ======================= -->  <!-- ============================================================== -->
    <include schemaLocation="geometryBasic2d.xsd" />
    <include schemaLocation="temporal.xsd" /> <!-- ============================================================== -->
    <element name="_Feature" type="gml:AbstractFeatureType" abstract="true" substitutionGroup="gml:_GML" /> <!-- =========================================================== -->
    <complexType name="AbstractFeatureType" abstract="true">
        <annotation>
            <documentation> An abstract feature provides a set of common properties, including id, metaDataProperty, name and description inherited from AbstractGMLType, plus boundedBy.    A concrete feature type must derive from this type and specify additional  properties in an application schema. A feature must possess an identifying attribute ('id' - 'fid' has been deprecated).  </documentation>
        </annotation>
        <complexContent>
            <extension base="gml:AbstractGMLType">
                <sequence>
                    <element ref="gml:boundedBy" minOccurs="0" />
                    <element ref="gml:location" minOccurs="0" /> <!-- additional properties must be specified in an application schema -->
                </sequence>
                <attribute name="fid" type="string">
                    <annotation>
                        <appinfo>deprecated</appinfo>
                        <documentation>deprecated in GML version 3.0</documentation>
                    </annotation>
                </attribute>
            </extension>
        </complexContent>
    </complexType> <!-- ============================================================== --> <!-- ===== property for feature association - by Value or by Reference ===== -->
    <element name="featureMember" type="gml:FeaturePropertyType" />
    <element name="featureProperty" type="gml:FeaturePropertyType" /> <!-- ============================================================== -->
    <complexType name="FeaturePropertyType">
        <annotation>
            <documentation>Container for a feature - follow gml:AssociationType pattern.</documentation>
        </annotation>
        <sequence>
            <element ref="gml:_Feature" minOccurs="0" />
        </sequence>
        <attributeGroup ref="gml:AssociationAttributeGroup" />
    </complexType> <!-- ============================================================== --> <!-- ===== property for association of an array of features ===== -->
    <element name="featureMembers" type="gml:FeatureArrayPropertyType" /> <!-- =========================================================== -->
    <complexType name="FeatureArrayPropertyType">
        <annotation>
            <documentation>Container for features - follow gml:ArrayAssociationType pattern.</documentation>
        </annotation>
        <sequence>
            <element ref="gml:_Feature" minOccurs="0" maxOccurs="unbounded" />
        </sequence>
    </complexType> <!-- ============================================================== --> <!-- =========== Bounded feature ========================= -->
    <complexType name="BoundedFeatureType" abstract="true">
        <annotation>
            <documentation> Makes boundedBy mandatory - used to build Feature Collections </documentation>
        </annotation>
        <complexContent>
            <restriction base="gml:AbstractFeatureType">
                <sequence>
                    <element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded" />
                    <element ref="gml:description" minOccurs="0" />
                    <element ref="gml:name" minOccurs="0" maxOccurs="unbounded" />
                    <element ref="gml:boundedBy" />
                    <element ref="gml:location" minOccurs="0" />
                </sequence>
            </restriction>
        </complexContent>
    </complexType> <!-- =========================================================== -->
    <element name="_FeatureCollection" type="gml:AbstractFeatureCollectionType" abstract="true" substitutionGroup="gml:_Feature" /> <!-- ===========================================================   -->
    <complexType name="AbstractFeatureCollectionType" abstract="true">
        <annotation>
            <documentation> A feature collection contains zero or more features.  </documentation>
        </annotation>
        <complexContent>
            <extension base="gml:BoundedFeatureType">
                <sequence>
                    <element ref="gml:featureMember" minOccurs="0" maxOccurs="unbounded" />
                    <element ref="gml:featureMembers" minOccurs="0" />
                </sequence>
            </extension>
        </complexContent>
    </complexType> <!-- =========================================================== -->
    <element name="FeatureCollection" type="gml:FeatureCollectionType" substitutionGroup="gml:_Feature" /> <!-- =========================================================== -->
    <complexType name="FeatureCollectionType">
        <annotation>
            <documentation> Concrete generic feature collection.  </documentation>
        </annotation>
        <complexContent>
            <extension base="gml:AbstractFeatureCollectionType" />
        </complexContent>
    </complexType> <!-- =========================================================== -->
    <element name="boundedBy" type="gml:BoundingShapeType" /> <!-- ====================================================================== -->
    <complexType name="BoundingShapeType">
        <annotation>
            <documentation>Bounding shape.</documentation>
        </annotation>
        <sequence>
            <group ref="gml:boundingShape" />
        </sequence>
    </complexType> <!-- ============================================================== -->
    <group name="boundingShape">
        <choice>
            <element ref="gml:Envelope" />
            <element ref="gml:Null" />
        </choice>
    </group> <!-- =========================================================== --> <!-- ========   global element declarations ======================================= -->
    <element name="Box" type="gml:EnvelopeType" substitutionGroup="gml:Envelope">
        <annotation>
            <appinfo>deprecated</appinfo>
            <documentation>deprecated with GML version 3.0</documentation>
        </annotation>
    </element> <!-- =========================================================== -->
    <element name="EnvelopeWithTimePeriod" type="gml:EnvelopeWithTimePeriodType" substitutionGroup="gml:Envelope" /> <!-- ====================================================================== -->
    <complexType name="EnvelopeWithTimePeriodType">
        <annotation>
            <documentation>Envelope that includes also a temporal extent.</documentation>
        </annotation>
        <complexContent>
            <extension base="gml:EnvelopeType">
                <sequence>
                    <element ref="gml:timePosition" minOccurs="2" maxOccurs="2" />
                </sequence>
                <attribute name="frame" type="anyURI" use="optional" default="#ISO-8601" />
            </extension>
        </complexContent>
    </complexType> <!-- ====================================================================== -->  <!-- ============================================================== -->
    <element name="location" type="gml:LocationPropertyType" substitutionGroup="gml:_property" /> <!-- ============================================================== -->
    <complexType name="LocationPropertyType">
        <annotation>
            <documentation>generalised locator property  - follow gml:AssociationType pattern</documentation>
        </annotation>
        <sequence>
            <group ref="gml:locator" minOccurs="0" />
        </sequence>
        <attributeGroup ref="gml:AssociationAttributeGroup" />
    </complexType>
    <group name="locator">
        <choice>
            <element ref="gml:_Geometry" />
            <element ref="gml:LocationKeyWord" />
            <element ref="gml:LocationString" />
        </choice>
    </group> <!-- ============================================================== -->
    <element name="LocationKeyWord" type="gml:CodeType" />
    <element name="LocationString" type="gml:StringOrRefType" /> <!-- =========================================================== -->
    <element name="priorityLocation" type="gml:PriorityLocationPropertyType" substitutionGroup="gml:location" /> <!-- ============================================================== -->
    <complexType name="PriorityLocationPropertyType">
        <annotation>
            <documentation>G-XML component</documentation>
        </annotation>
        <complexContent>
            <extension base="gml:LocationPropertyType">
                <attribute name="priority" type="string" use="optional" />
            </extension>
        </complexContent>
    </complexType> <!-- ============================================================== --> <!-- common aliases for geometry properties -->
    <element name="centerOf" type="gml:PointPropertyType" substitutionGroup="gml:pointProperty" />
    <element name="position" type="gml:PointPropertyType" substitutionGroup="gml:pointProperty" />
    <element name="edgeOf" type="gml:CurvePropertyType" substitutionGroup="gml:curveProperty" />
    <element name="centerLineOf" type="gml:CurvePropertyType" substitutionGroup="gml:curveProperty" />
    <element name="extentOf" type="gml:SurfacePropertyType" substitutionGroup="gml:surfaceProperty" />
    <element name="coverage" type="gml:SurfacePropertyType" substitutionGroup="gml:surfaceProperty">
        <annotation>
            <appinfo>deprecated</appinfo>
            <documentation>deprecated in gml 3.0</documentation>
        </annotation>
    </element> <!-- ============================================================== -->
</schema>