<?xml version="1.0" encoding="UTF-8"?>
<!-- CityGML Profil der AdV, LoD 2, Version 11.10.2014-->
<!-- Editor: Ulrich Gruber, Kreis Recklinghausen, Kurt-Schumacher-Allee 1,  45657 Recklinghausen -->
<!-- Weitere Informationen unter www.adv-online.de -->
<xs:schema xmlns="http://www.opengis.net/citygml/cityobjectgroup/1.0"
    xmlns:core="http://www.opengis.net/citygml/1.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml"
    targetNamespace="http://www.opengis.net/citygml/cityobjectgroup/1.0" elementFormDefault="qualified"
    attributeFormDefault="unqualified">
  	<xs:import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd" /> 
	<xs:import namespace="http://www.opengis.net/citygml/1.0" schemaLocation="http://repository.gdi-de.org/schemas/adv/citygml/1.0/cityGMLBaseLoD2.xsd"/>
    <!-- ========================================================================================= -->
    <!-- =============================CityGML CityObjectGroup module ================================== -->
    <!-- ========================================================================================= -->
    <xs:complexType name="CityObjectGroupType">
        <xs:annotation>
            <xs:documentation> A group may be used to aggregate arbitrary CityObjects according to some user-defined criteria.
                Examples for groups are the buildings in a specific region, the result of a query, or objects put together for
                visualization purposes. Each group has a name (inherited from AbstractGMLType), functions (e.g., building group),
                a class and zero or more usages. A geometry may optionally be attached to a group, if the geometry of the whole
                group differs from the geometry of the parts. Each member of a group may be qualified by a role name, reflecting
                the role each CityObject plays in the context of the group. As subclass of _CityObject, a CityObjectGroup inherits
                all attributes and relations, in particular an id, names, external references, and generalization relations. As
                CityObjectGroup itself is a CityObject, it may also be contained by another group. </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="core:AbstractCityObjectType">
                <xs:sequence>
                    <xs:element name="class" type="xs:string" minOccurs="0"/>
                    <xs:element name="function" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element name="usage" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element name="groupMember" type="CityObjectGroupMemberType" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element name="parent" type="CityObjectGroupParentType" minOccurs="0"/>
                    <xs:element name="geometry" type="gml:GeometryPropertyType" minOccurs="0"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <!-- ========================================================================================= -->
    <xs:element name="CityObjectGroup" type="CityObjectGroupType" substitutionGroup="core:_CityObject"/>
    <!-- ========================================================================================= -->
    <!-- ======================Type for Aggregation of Group Members==================================== -->
    <!-- ========================================================================================= -->
    <xs:complexType name="CityObjectGroupMemberType">
        <xs:annotation>
            <xs:documentation>Denotes the relation of a CityObjectGroup to its members, which are _CityObjects. The
                CityObjectGroupMemberType element must either carry a reference to a _CityObject object or contain a _CityObject
                object inline, but neither both nor none. </xs:documentation>
        </xs:annotation>
        <xs:sequence minOccurs="0">
            <xs:element ref="core:_CityObject"/>
        </xs:sequence>
        <xs:attribute name="role" type="xs:string"/>
        <xs:attributeGroup ref="gml:AssociationAttributeGroup"/>
    </xs:complexType>
    <!-- ========================================================================================= -->
    <!-- ======================Type for Parent Property ================================================ -->
    <!-- ========================================================================================= -->
    <xs:complexType name="CityObjectGroupParentType">
        <xs:annotation>
            <xs:documentation>Denotes the relation of a CityObjectGroup to its parent, which is a CityObject. The
                CityObjectGroupParentType element must either carry a reference to a _CityObject object or contain a _CityObject
                object inline, but neither both nor none. The parent association allows for modelling of a generic hierarchical
                grouping concept. Named aggregations of components (CityObjects) can be added to specific CityObjects considered
                as the parent object. The parent association links to the aggregate, while the parts are given by the group
                members. </xs:documentation>
        </xs:annotation>
        <xs:sequence minOccurs="0">
            <xs:element ref="core:_CityObject"/>
        </xs:sequence>
        <xs:attributeGroup ref="gml:AssociationAttributeGroup"/>
    </xs:complexType>
    <!-- ========================================================================================= -->
</xs:schema>
