Ok,
I've got Building to work as a feature and I managed to map a the attribute 
boundedBy in building to another feature Wallsurface. As I understand both 
Building and Wallsurface is top level features and it all seems to work great.

The problem occurs when I try to map 3dcitydb SURFACE_GEOMETRY table against 
lod2MultiSurface. If I try to map lod2MultiSurface directly as a type I get:
"lod2MultiSurface is not a top level type" 
and If I use lod2MultiSurface as a attribute on WallSurface and maps 
SURFACE_GEOMETRY as a gml:MultiSurface I get:
Error occurred getting features null 
org.geotools.feature.type.AttributeTypeImpl cannot be cast to 
org.opengis.feature.type.ComplexType

Anyone got any pointers? There are no more "top level features" that I can use 
in the bldg namespace but I don't seem to be able to map gml:MultiSurface.

I attached the mappingfile for WallSurface and MultiSurface (Geometry.xml)


Thank you for any help you can give.
/Lukas



-----Ursprungligt meddelande-----
Från: Ben Caradoc-Davies [mailto:ben.caradoc-dav...@csiro.au] 
Skickat: den 25 mars 2011 04:26
Till: Lukas Johansson
Kopia: geoserver-users@lists.sourceforge.net
Ämne: Re: [Geoserver-users] Problem with appschema and CityGML

Good to hear. Please let us know if you encounter any further problems.

Kind regards,
Ben.

On 22/03/11 01:47, Lukas Johansson wrote:
> Ok, solved this issue. I had forgot to put the correct schemaUri in 
> targettypes of  Building mapping file.
> /Lukas
>
> Från: Lukas Johansson [mailto:lukas.johans...@decerno.se]
> Skickat: den 21 mars 2011 09:45
> Till: geoserver-users@lists.sourceforge.net
> Ämne: [Geoserver-users] Problem with appschema and CityGML
>
> I’m having trouble setting up GeoServer application Schema plugin to serve a 
> subset of CityGML.
> The data is  stored in a Oracle Spatial database (3DCityDB schema) and I’ve 
> managed to publish feature types for core:CityModel and core:_CityObject. 
> Whenever I try to create a mapping file for Building I get this error:
>
> No top level element found in schemas: 
> {http://www.opengis.net/citygml/1.0}Building
>
> The reason to why I mapped core:_CityObject is because  Building inherits 
> from core:_Site which in turn inherits from core:CityObject. When I use 
> _CityObject instead of building it works and I can map the feature as I want. 
> It does however get encoded into _CityObject and I need it to be encoded as 
> Building.
>
> I tried tons’ of configurations but none seems to work for me. Included in 
> this email is the mappingfile for CityModel, Building and _CityObject
>
> Any help whatsoever would be deeply appreciated as I banged my head for weeks 
> now while reading the manual back and forth.
>
> Thank you!
> Lukas
> ___________________________
> Lukas Johansson
> Civilingenjör
> Decerno AB
> Electrum 234, SE-164 40 KISTA
> Besöksadress: Kistagången 16, 7 tr
> Tel:    +46 8 630 75 00
> Mobil: +46 70 644 96 61
>
> [cid:image001.jpg@01CBE7F8.630A82D0]<http://www.decerno.se/>
>
>

-- 
Ben Caradoc-Davies <ben.caradoc-dav...@csiro.au>
Software Engineering Team Leader
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre
<?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>gml</prefix>
            <uri>http://www.opengis.net/gml</uri>
        </Namespace>
        <Namespace>
            <prefix>core</prefix>
            <uri>http://www.opengis.net/citygml/1.0</uri>
        </Namespace>
        <Namespace>
            <prefix>bldg</prefix>
            <uri>http://www.opengis.net/citygml/building/1.0</uri>
        </Namespace>
		<Namespace>
		    <prefix>xlink</prefix>
		    <uri>http://www.w3.org/1999/xlink</uri>
		</Namespace>
		<Namespace>
            <prefix>gsml</prefix>
            <uri>urn:cgi:xmlns:CGI:GeoSciML:2.0</uri>
        </Namespace>
    </namespaces>
 
    <includedTypes>
    	<Include>Geometry.xml</Include>
	</includedTypes>
 
    <sourceDataStores>
	   	<DataStore>
		  <id>citydb</id>
		  <parameters>
		  <Parameter>
			<name>dbtype</name>
			<value>Oracle</value>
	  	  </Parameter>
		  <Parameter>
			<name>host</name>
			<value>localhost</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>port</name>
			<value>1521</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>database</name>
			<value>orcl</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>user</name>
			<value>foi</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>schema</name>
			<value>foi</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>passwd</name>
			<value>foi</value>
	  	  </Parameter>
		  </parameters>
		</DataStore>
    </sourceDataStores>
    <catalog>../../../schemas/catalog.xml</catalog>
    <targetTypes>
    <FeatureType>
            <schemaUri>http://schemas.opengis.net/citygml/1.0/cityGMLBase.xsd</schemaUri>
        </FeatureType>
        <FeatureType>
            <schemaUri>http://schemas.opengis.net/citygml/building/1.0/building.xsd</schemaUri>
        </FeatureType>
    </targetTypes>
    <typeMappings>
        <FeatureTypeMapping>
      		<sourceDataStore>citydb</sourceDataStore>
         	<sourceType>THEMATIC_SURFACE</sourceType>
            <targetElement>bldg:WallSurface</targetElement>
            <attributeMappings>
            	<AttributeMapping>
            		<targetAttribute>
                		bldg:WallSurface
            		</targetAttribute>
            	</AttributeMapping>
      	 		<AttributeMapping>
            		<targetAttribute>bldg:lod2MultiSurface</targetAttribute>
            		<sourceExpression>
                    	<OCQL>LOD2_MULTI_SURFACE_ID</OCQL>
                    	<linkElement>gml:MultiSurface</linkElement>
                    	<linkField>FEATURE_LINK</linkField>
                    </sourceExpression>
             	</AttributeMapping>
       
             	<AttributeMapping>
					<targetAttribute>gml:name</targetAttribute>
					<sourceExpression><OCQL>LOD2_MULTI_SURFACE_ID</OCQL></sourceExpression>
				</AttributeMapping>
               	
             	<AttributeMapping>
					<targetAttribute>FEATURE_LINK</targetAttribute>
					<sourceExpression><OCQL>BUILDING_ID</OCQL></sourceExpression>
				</AttributeMapping>
            </attributeMappings>
    	</FeatureTypeMapping>
    </typeMappings>
</as:AppSchemaDataAccess>
<?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>gml</prefix>
            <uri>http://www.opengis.net/gml</uri>
        </Namespace>
        <Namespace>
            <prefix>core</prefix>
            <uri>http://www.opengis.net/citygml/1.0</uri>
        </Namespace>
        <Namespace>
            <prefix>bldg</prefix>
            <uri>http://www.opengis.net/citygml/building/1.0</uri>
        </Namespace>
		<Namespace>
		    <prefix>xlink</prefix>
		    <uri>http://www.w3.org/1999/xlink</uri>
		</Namespace>
		<Namespace>
            <prefix>gsml</prefix>
            <uri>urn:cgi:xmlns:CGI:GeoSciML:2.0</uri>
        </Namespace>
    </namespaces>

    <sourceDataStores>
	   	<DataStore>
		  <id>citydb</id>
		  <parameters>
		  <Parameter>
			<name>dbtype</name>
			<value>Oracle</value>
	  	  </Parameter>
		  <Parameter>
			<name>host</name>
			<value>localhost</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>port</name>
			<value>1521</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>database</name>
			<value>orcl</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>user</name>
			<value>foi</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>schema</name>
			<value>foi</value>
	  	  </Parameter>
	
		  <Parameter>
			<name>passwd</name>
			<value>foi</value>
	  	  </Parameter>
		  </parameters>
		</DataStore>
    </sourceDataStores>
    <catalog>../../../schemas/catalog.xml</catalog>
    <targetTypes>
    <FeatureType>
            <schemaUri>http://schemas.opengis.net/citygml/1.0/cityGMLBase.xsd</schemaUri>
        </FeatureType>
        <FeatureType>
            <schemaUri>http://schemas.opengis.net/citygml/building/1.0/building.xsd</schemaUri>
        </FeatureType>
  <!--       <FeatureType>
            <schemaUri>http://schemas.opengis.net/gml/3.1.1/base/gmlBase.xsd</schemaUri>
        </FeatureType>
         -->
    </targetTypes>
    <typeMappings>
        <FeatureTypeMapping>
      		<sourceDataStore>citydb</sourceDataStore>
         	<sourceType>SURFACE_GEOMETRY</sourceType>
            <targetElement>gml:MultiSurface</targetElement>
            <attributeMappings>
            	<AttributeMapping>
            		<targetAttribute>
                		gml:MultiSurface
            		</targetAttribute>
            	</AttributeMapping>      	
               	
             	<AttributeMapping>
             		<targetAttribute>FEATURE_LINK</targetAttribute>
             		<sourceExpression><OCQL>strSubStringStart(getId(), strIndexOf(getId(), '.')+1)</OCQL></sourceExpression>
             	</AttributeMapping>
            </attributeMappings>
    	</FeatureTypeMapping>
    </typeMappings>
</as:AppSchemaDataAccess>
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to