5.1 ZoningElement

The ZoningElements have only one data source, a shapefile with Planned Land Use.

    <sourceDataStores>
        <DataStore>
            <id>shp_PLU</id>
            <parameters>
                <Parameter>
                    <name>url</name>
                    <value>
                        file:../../../data/tutorial/PLU.shp
                    </value>
                </Parameter>
                <Parameter>
                    <name>memory mapped buffer</name>
                    <value>false</value>
                </Parameter>
                <Parameter>
                    <name>create spatial index</name>
                    <value>true</value>
                </Parameter>
                <Parameter>
                    <name>charset</name>
                    <value>ISO-8859-1</value>
                </Parameter>
            </parameters>
        </DataStore>
    </sourceDataStores>

The target types are available at the PlannedLandUse application schema.

    <targetTypes>
        <FeatureType>
            <schemaUri>
                http://{$server.ip}/datos/inspire_data_model/xsds/PlannedLandUse.xsd
            </schemaUri>
        </FeatureType>
    </targetTypes>

There's only one mapped feature type in this file:

    <typeMappings>
        <FeatureTypeMapping>
            <sourceDataStore>
                shp_PLU
            </sourceDataStore>
            <sourceType>
                PLU
            </sourceType>
            <targetElement>
                plu:ZoningElement
            </targetElement>

The gml:id property and the InspireId attribute are mapped as usual, with a namespace and an id:

    <attributeMappings>
        <AttributeMapping>
            <targetAttribute>
                plu:ZoningElement
            </targetAttribute>
            <idExpression>
                <OCQL>
                    strConcat('Gijon.PLU.ZoningElement.', id)
                </OCQL>
            </idExpression>
        </AttributeMapping>
        <AttributeMapping>
            <targetAttribute>
                lucm:inspireId/base:Identifier/base:localId
            </targetAttribute>
            <sourceExpression>
                <OCQL>
                    id
                </OCQL>
            </sourceExpression>
        </AttributeMapping>
        <AttributeMapping>
            <targetAttribute>
                lucm:inspireId/base:Identifier/base:namespace
            </targetAttribute>
            <sourceExpression>
                <OCQL>
                    'Gijon.PLU.ZoningElement'
                </OCQL>
            </sourceExpression>
        </AttributeMapping>

The beginLifespanVersion attribute will be a constant for this feature type:

    <AttributeMapping>
        <targetAttribute>
            lucm:beginLifespanVersion
        </targetAttribute>
        <sourceExpression>
            <OCQL>
                '2011-01-01'
            </OCQL>
        </sourceExpression>
    </AttributeMapping>


There are two attributes to reflect the Land Use of the Zoning Element:
- dominantLandUse: with the land use class according to the HILUCS classification.
- specificLandUse: with the land use class according to a local classification.

    <AttributeMapping>
        <targetAttribute>
            lucm:dominantLandUse
        </targetAttribute>
        <sourceExpression>
            <OCQL>
               j_hilucs_c                        
            </OCQL>
        </sourceExpression>
        <ClientProperty>
            <name>codeSpace</name>
            <value>
                    'http://inspire.jrc.ec.europa.eu/schemas/lucm/2.0/HILUCSValue'
            </value>
        </ClientProperty>
    </AttributeMapping>
    <AttributeMapping>
        <targetAttribute>
            lucm:specificLandUse
        </targetAttribute>
        <sourceExpression>
            <OCQL>
                Tipo_str
            </OCQL>
        </sourceExpression>
        <ClientProperty>
            <name>codeSpace</name>
            <value>
                    'http://inspire.jrc.ec.europa.eu/schemas/lucm/2.0/LandUseClassificationValue'
            </value>
        </ClientProperty>
    </AttributeMapping>

Finally, the last mandatory attribute is the legal nature of this ZoningElement:

    <AttributeMapping>
        <targetAttribute>
            plu:regulationNature
        </targetAttribute>
        <sourceExpression>
            <OCQL>'generallyBinding'</OCQL>
        </sourceExpression>
    </AttributeMapping>

This is the complete content of the mapping file:

<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
    <namespaces>
        <Namespace>
            <prefix>plu</prefix>
            <uri>
                http://inspire.jrc.ec.europa.eu/schemas/plu/2.0
            </uri>
        </Namespace>        
        <Namespace>
            <prefix>lucm</prefix>
            <uri>
                http://inspire.jrc.ec.europa.eu/schemas/lucm/2.0
            </uri>
        </Namespace>
        <Namespace>
            <prefix>base</prefix>
            <uri>
                urn:x-inspire:specification:gmlas:BaseTypes:3.2
            </uri>
        </Namespace>
        <Namespace>
            <prefix>xsi</prefix>
            <uri>http://www.w3.org/2001/XMLSchema-instance</uri>
        </Namespace>
    </namespaces>
    <sourceDataStores>
        <DataStore>
            <id>shp_PLU</id>
            <parameters>
                <Parameter>
                    <name>url</name>
                    <value>
                        file:../../../data/tutorial/PLU.shp
                    </value>
                </Parameter>
                <Parameter>
                    <name>memory mapped buffer</name>
                    <value>false</value>
                </Parameter>
                <Parameter>
                    <name>create spatial index</name>
                    <value>true</value>
                </Parameter>
                <Parameter>
                    <name>charset</name>
                    <value>ISO-8859-1</value>
                </Parameter>
            </parameters>
        </DataStore>
    </sourceDataStores>

    <targetTypes>
        <FeatureType>
            <schemaUri>
                http://{$server.ip}/datos/inspire_data_model/xsds/PlannedLandUse.xsd
            </schemaUri>
        </FeatureType>
    </targetTypes>

    <typeMappings>
        <FeatureTypeMapping>
            <sourceDataStore>
                shp_PLU
            </sourceDataStore>
            <sourceType>
                PLU
            </sourceType>
            <targetElement>
                plu:ZoningElement
            </targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>
                        plu:ZoningElement
                    </targetAttribute>
                    <idExpression>
                        <OCQL>
                            strConcat('Gijon.PLU.ZoningElement.', id)
                        </OCQL>
                    </idExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>
                        lucm:inspireId/base:Identifier/base:localId
                    </targetAttribute>
                    <sourceExpression>
                        <OCQL>
                            id
                        </OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>
                        lucm:inspireId/base:Identifier/base:namespace
                    </targetAttribute>
                    <sourceExpression>
                        <OCQL>
                            'Gijon.PLU.ZoningElement'
                        </OCQL>
                    </sourceExpression>
                </AttributeMapping>

                <AttributeMapping>
                        <targetAttribute>
                            lucm:beginLifespanVersion
                        </targetAttribute>
                        <sourceExpression>
                            <OCQL>
                                '2011-01-01'
                            </OCQL>
                        </sourceExpression>
                </AttributeMapping>
                            
                <AttributeMapping>
                        <targetAttribute>
                            lucm:dominantLandUse
                        </targetAttribute>
                        <sourceExpression>
                            <OCQL>
                               j_hilucs_c                        
                            </OCQL>
                        </sourceExpression>
                        <ClientProperty>
                            <name>codeSpace</name>
                            <value>
                                    'http://inspire.jrc.ec.europa.eu/schemas/lucm/2.0/HILUCSValue'
                            </value>
                        </ClientProperty>
                </AttributeMapping>
                
                  <AttributeMapping>
                        <targetAttribute>
                            lucm:specificLandUse
                        </targetAttribute>
                        <sourceExpression>
                            <OCQL>
                                Tipo_str
                            </OCQL>
                        </sourceExpression>
                        <ClientProperty>
                            <name>codeSpace</name>
                            <value>
                                    'http://inspire.jrc.ec.europa.eu/schemas/lucm/2.0/LandUseClassificationValue'
                            </value>
                        </ClientProperty>
                </AttributeMapping>
                
                <AttributeMapping>
                    <targetAttribute>
                        plu:regulationNature
                    </targetAttribute>
                    <sourceExpression>
                        <OCQL>'generallyBinding'</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
    </typeMappings>
</as:AppSchemaDataAccess>



Comments