<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns:xlink="http://www.w3.org/1999/xlink" targetNamespace="http://www.opengis.net/gml" elementFormDefault="qualified" version="3.2.0" finalDefault="" blockDefault="" attributeFormDefault="unqualified">
    <annotation>
        <appinfo source="urn:opengis:specification:gml:schema-xsd:geometryBasic0d1d:v3.2.0">geometryBasic0d1d.xsd</appinfo>
        <documentation>see GML 9.2.1-9.2.3</documentation>
    </annotation>
    <include schemaLocation="measures.xsd"/>
    <complexType name="AbstractGeometryType" abstract="true" mixed="false">
        <xsd:complexContent xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <extension base="gml:AbstractGMLType">
                <attributeGroup ref="gml:SRSReferenceGroup"/>
            </extension>
        </xsd:complexContent>
    </complexType>
    <attributeGroup name="SRSReferenceGroup">
        <attribute name="srsName" type="anyURI" use="optional"/>
        <attribute name="srsDimension" type="positiveInteger" use="optional"/>
        <attributeGroup ref="gml:SRSInformationGroup"/>
    </attributeGroup>
    <attributeGroup name="SRSInformationGroup">
        <attribute name="axisLabels" type="gml:NCNameList" use="optional"/>
        <attribute name="uomLabels" type="gml:NCNameList" use="optional"/>
    </attributeGroup>
    <element name="AbstractGeometry" type="gml:AbstractGeometryType" abstract="true" substitutionGroup="gml:AbstractGML" nillable="false"/>
    <complexType name="GeometryPropertyType" mixed="false" abstract="false">
        <sequence minOccurs="0" maxOccurs="1">
            <element ref="gml:AbstractGeometry" minOccurs="1" maxOccurs="1" nillable="false"/>
        </sequence>
        <attributeGroup ref="gml:AssociationAttributeGroup"/>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    </complexType>
    <complexType name="GeometryArrayPropertyType" mixed="false" abstract="false">
        <sequence minOccurs="0" maxOccurs="unbounded">
            <element ref="gml:AbstractGeometry" minOccurs="1" maxOccurs="1" nillable="false"/>
        </sequence>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    </complexType>
    <complexType name="DirectPositionType" mixed="false" abstract="false">
        <simpleContent>
            <extension base="gml:doubleList">
                <attributeGroup ref="gml:SRSReferenceGroup"/>
            </extension>
        </simpleContent>
    </complexType>
    <element name="pos" type="gml:DirectPositionType" nillable="false" abstract="false">
        <annotation>
            <appinfo>
                <sch:pattern name="CRS attributes constraints">
                    <sch:rule id="CRSLabelsPos">
                        <sch:report test="not(@srsDimension) or @srsName">The presence of a dimension attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="not(@axisLabels) or @srsName">The presence of an axisLabels attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="not(@uomLabels) or @srsName">The presence of an uomLabels attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="(not(@uomLabels) and not(@axisLabels)) or (@uomLabels and @axisLabels)">The presence of an uomLabels attribute implies the presence of the axisLabels attribute and vice versa.</sch:report>
                    </sch:rule>
                </sch:pattern>
            </appinfo>
        </annotation>
    </element>
    <complexType name="DirectPositionListType" mixed="false" abstract="false">
        <simpleContent>
            <extension base="gml:doubleList">
                <attributeGroup ref="gml:SRSReferenceGroup"/>
                <attribute name="count" type="positiveInteger" use="optional"/>
            </extension>
        </simpleContent>
    </complexType>
    <element name="posList" type="gml:DirectPositionListType" nillable="false" abstract="false">
        <annotation>
            <appinfo>
                <sch:pattern name="CRS attributes constraints">
                    <sch:rule id="CRSLabelsPosList">
                        <sch:report test="not(@srsDimension) or @srsName">The presence of a dimension attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="not(@axisLabels) or @srsName">The presence of an axisLabels attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="not(@uomLabels) or @srsName">The presence of an uomLabels attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="(not(@uomLabels) and not(@axisLabels)) or (@uomLabels and @axisLabels)">The presence of an uomLabels attribute implies the presence of the axisLabels attribute and vice versa.</sch:report>
                    </sch:rule>
                </sch:pattern>
                <sch:pattern name="count attribute constraints">
                    <sch:rule id="Count">
                        <sch:report test="not(@count) or @srsDimension">The presence of a count attribute implies the presence of the dimension attribute.</sch:report>
                    </sch:rule>
                </sch:pattern>
            </appinfo>
        </annotation>
    </element>
    <group name="geometricPositionGroup">
        <choice>
            <element ref="gml:pos" minOccurs="1" maxOccurs="1" nillable="false"/>
            <element ref="gml:pointProperty" minOccurs="1" maxOccurs="1" nillable="false"/>
        </choice>
    </group>
    <group name="geometricPositionListGroup">
        <choice>
            <element ref="gml:posList" minOccurs="1" maxOccurs="1" nillable="false"/>
            <group ref="gml:geometricPositionGroup" maxOccurs="unbounded" minOccurs="1"/>
        </choice>
    </group>
    <element name="coordinates" type="gml:CoordinatesType" nillable="false" abstract="false"/>
    <complexType name="VectorType" mixed="false" abstract="false">
        <simpleContent>
            <restriction base="gml:DirectPositionType"/>
        </simpleContent>
    </complexType>
    <element name="vector" type="gml:VectorType" nillable="false" abstract="false">
        <annotation>
            <appinfo>
                <sch:pattern name="CRS attributes constraints">
                    <sch:rule id="CRSLabelsVector">
                        <sch:report test="not(@srsDimension) or @srsName">The presence of a dimension attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="not(@axisLabels) or @srsName">The presence of an axisLabels attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="not(@uomLabels) or @srsName">The presence of an uomLabels attribute implies the presence of the srsName attribute.</sch:report>
                        <sch:report test="(not(@uomLabels) and not(@axisLabels)) or (@uomLabels and @axisLabels)">The presence of an uomLabels attribute implies the presence of the axisLabels attribute and vice versa.</sch:report>
                    </sch:rule>
                </sch:pattern>
            </appinfo>
        </annotation>
    </element>
    <complexType name="EnvelopeType" mixed="false" abstract="false">
        <choice minOccurs="1" maxOccurs="1">
            <sequence minOccurs="1" maxOccurs="1">
                <element name="lowerCorner" type="gml:DirectPositionType" minOccurs="1" maxOccurs="1" nillable="false"/>
                <element name="upperCorner" type="gml:DirectPositionType" minOccurs="1" maxOccurs="1" nillable="false"/>
            </sequence>
            <element ref="gml:pos" minOccurs="2" maxOccurs="2" nillable="false"/>
            <element ref="gml:coordinates" minOccurs="1" maxOccurs="1" nillable="false"/>
        </choice>
        <attributeGroup ref="gml:SRSReferenceGroup"/>
    </complexType>
    <element name="Envelope" type="gml:EnvelopeType" substitutionGroup="gml:AbstractObject" nillable="false" abstract="false"/>
    <complexType name="AbstractGeometricPrimitiveType" abstract="true" mixed="false">
        <xsd:complexContent xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <extension base="gml:AbstractGeometryType"/>
        </xsd:complexContent>
    </complexType>
    <element name="AbstractGeometricPrimitive" type="gml:AbstractGeometricPrimitiveType" abstract="true" substitutionGroup="gml:AbstractGeometry" nillable="false"/>
    <complexType name="GeometricPrimitivePropertyType" mixed="false" abstract="false">
        <sequence minOccurs="0" maxOccurs="1">
            <element ref="gml:AbstractGeometricPrimitive" minOccurs="1" maxOccurs="1" nillable="false"/>
        </sequence>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
        <attributeGroup ref="gml:AssociationAttributeGroup"/>
    </complexType>
    <complexType name="PointType" mixed="false" abstract="false">
        <xsd:complexContent xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <extension base="gml:AbstractGeometricPrimitiveType">
                <sequence minOccurs="1" maxOccurs="1">
                    <choice minOccurs="1" maxOccurs="1">
                        <element ref="gml:pos" minOccurs="1" maxOccurs="1" nillable="false"/>
                        <element ref="gml:coordinates" minOccurs="1" maxOccurs="1" nillable="false"/>
                    </choice>
                </sequence>
            </extension>
        </xsd:complexContent>
    </complexType>
    <element name="Point" type="gml:PointType" substitutionGroup="gml:AbstractGeometricPrimitive" nillable="false" abstract="false"/>
    <complexType name="PointPropertyType" mixed="false" abstract="false">
        <sequence minOccurs="0" maxOccurs="1">
            <element ref="gml:Point" minOccurs="1" maxOccurs="1" nillable="false"/>
        </sequence>
        <attributeGroup ref="gml:AssociationAttributeGroup"/>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    </complexType>
    <element name="pointProperty" type="gml:PointPropertyType" nillable="false" abstract="false"/>
    <element name="pointRep" type="gml:PointPropertyType" nillable="false" abstract="false"/>
    <complexType name="PointArrayPropertyType" mixed="false" abstract="false">
        <sequence minOccurs="0" maxOccurs="unbounded">
            <element ref="gml:Point" minOccurs="1" maxOccurs="1" nillable="false"/>
        </sequence>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    </complexType>
    <element name="pointArrayProperty" type="gml:PointArrayPropertyType" nillable="false" abstract="false"/>
    <complexType name="AbstractCurveType" abstract="true" mixed="false">
        <xsd:complexContent xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <extension base="gml:AbstractGeometricPrimitiveType"/>
        </xsd:complexContent>
    </complexType>
    <element name="AbstractCurve" type="gml:AbstractCurveType" abstract="true" substitutionGroup="gml:AbstractGeometricPrimitive" nillable="false"/>
    <complexType name="CurvePropertyType" mixed="false" abstract="false">
        <sequence minOccurs="0" maxOccurs="1">
            <element ref="gml:AbstractCurve" minOccurs="1" maxOccurs="1" nillable="false"/>
        </sequence>
        <attributeGroup ref="gml:AssociationAttributeGroup"/>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    </complexType>
    <element name="curveProperty" type="gml:CurvePropertyType" nillable="false" abstract="false"/>
    <complexType name="CurveArrayPropertyType" mixed="false" abstract="false">
        <sequence minOccurs="0" maxOccurs="unbounded">
            <element ref="gml:AbstractCurve" minOccurs="1" maxOccurs="1" nillable="false"/>
        </sequence>
        <attributeGroup ref="gml:OwnershipAttributeGroup"/>
    </complexType>
    <element name="curveArrayProperty" type="gml:CurveArrayPropertyType" nillable="false" abstract="false"/>
    <complexType name="LineStringType" mixed="false" abstract="false">
        <xsd:complexContent xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <extension base="gml:AbstractCurveType">
                <sequence minOccurs="1" maxOccurs="1">
                    <choice minOccurs="1" maxOccurs="1">
                        <choice minOccurs="2" maxOccurs="unbounded">
                            <element ref="gml:pos" minOccurs="1" maxOccurs="1" nillable="false"/>
                            <element ref="gml:pointProperty" minOccurs="1" maxOccurs="1" nillable="false"/>
                            <element ref="gml:pointRep" minOccurs="1" maxOccurs="1" nillable="false"/>
                        </choice>
                        <element ref="gml:posList" minOccurs="1" maxOccurs="1" nillable="false"/>
                        <element ref="gml:coordinates" minOccurs="1" maxOccurs="1" nillable="false"/>
                    </choice>
                </sequence>
            </extension>
        </xsd:complexContent>
    </complexType>
    <element name="LineString" type="gml:LineStringType" substitutionGroup="gml:AbstractCurve" nillable="false" abstract="false"/>
    <complexType name="AbstractSurfaceType" abstract="true" mixed="false">
        <xsd:complexContent xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <extension base="gml:AbstractGeometricPrimitiveType"/>
        </xsd:complexContent>
    </complexType>
</schema>