A Sample GeoServer Mapping file for NCGMP09 to GeoSciML
This is a snippet from a GeoServer/App-schema mapping file. The type mapping section is where you indicate what fields in your source data go into which fields in your output data. This particular set of AttributeMappings should take polygons from an NCGMP09 dataset and output gsml:MappedFeatures.
Two caveats: First, the Join represented in the gsml:specification element will not work without the appropriate gsml:GeologicUnit featuretype also being implemented. Second, I'm not sure yet how to implement the gsml:metadata field, so that's commented out.
Attached is an example of a GeoSciML WFS output that uses this mapping. Note that the nested GeologiUnit mapping is not yet complete, so might not be totally conformant.
For a little more discussion of the syntax of the AttributeMapping elements, see this post: NCGMP to GeoSciML: MappedFeature
<typeMappings>
<FeatureTypeMapping>
<sourceDataStore>datastore</sourceDataStore>
<sourceType>mapunitpolys</sourceType>
<targetElement>gsml:MappedFeature</targetElement>
<attributeMappings>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE ID VALUE -->
<!-- From the mapunitpolys_id field in source data -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gsml:MappedFeature
</targetAttribute>
<idExpression>
<OCQL>mapunitpolys_id</OCQL>
</idExpression>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE LABEL -->
<!-- From the label field in source data -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gml:name[1]
</targetAttribute>
<sourceExpression>
<OCQL>label</OCQL>
</sourceExpression>
<ClientProperty>
<name>codeSpace</name>
<value>'ncgmp:label'</value>
</ClientProperty>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- NCGMP AREASYMBOL -->
<!-- From the areasymbol field in source data -->
<!-- This is stuck into a gml:name field so that -->
<!-- it is possible to round-trip the data to -->
<!-- GeoSciML and back to NCGMP09 -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gml:name[2]
</targetAttribute>
<sourceExpression>
<OCQL>areasymbol</OCQL>
</sourceExpression>
<ClientProperty>
<name>codeSpace</name>
<value>'ncgmp:areaSymbol'</value>
</ClientProperty>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- NCGMP IDENTITYCONFIDENCE -->
<!-- From identityconfidence field in source data -->
<!-- This is stuck into a gml:name field so that -->
<!-- it is possible to round-trip the data to -->
<!-- GeoSciML and back to NCGMP09 -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gml:name[3]
</targetAttribute>
<sourceExpression>
<OCQL>identityconfidence</OCQL>
</sourceExpression>
<ClientProperty>
<name>codeSpace</name>
<value>'ncgmp:identityConfidence'</value>
</ClientProperty>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE DESCRIPTION -->
<!-- From the notes field in source data -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gml:description
</targetAttribute>
<sourceExpression>
<OCQL>notes</OCQL>
</sourceExpression>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE OBSERVATIONMETHOD -->
<!-- NoData to support this in NCGMP09 schema -->
<!-- Required in GeoSciML, put a null value in -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gsml:observationMethod/gsml:CGI_TermValue/gsml:value
</targetAttribute>
<sourceExpression>
<OCQL>'urn:ogc:def:nil:OGC:missing'</OCQL>
</sourceExpression>
<ClientProperty>
<name>codeSpace</name>
<value>'urn:ietf:rfc:2141'</value>
</ClientProperty>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE POSITIONALACCURACY -->
<!-- NoData to support this in MapUnitPolys -->
<!-- Required in GeoSciML, put a null value in -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gsml:positionalAccuracy
</targetAttribute>
<targetAttributeNode>
gsml:CGI_TermValuePropertyType
</targetAttributeNode>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>
gsml:positionalAccuracy/gsml:CGI_TermValue/gsml:value
</targetAttribute>
<sourceExpression>
<OCQL>'urn:ogc:def:nil:OGC:missing'</OCQL>
</sourceExpression>
<ClientProperty>
<name>codeSpace</name>
<value>'urn:ietf:rfc:2141'</value>
</ClientProperty>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE SAMPLINGFRAME -->
<!-- NoData to support this in NCGMP -->
<!-- Required in GeoSciML, assume EarthSurface -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gsml:samplingFrame
</targetAttribute>
<ClientProperty>
<name>xlink:href</name>
<value>'urn:cgi:feature:CGI:EarthNaturalSurface'</value>
</ClientProperty>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE SPECIFICATION -->
<!-- For polygons, this is a gsml:GeologicUnit -->
<!-- In NCGMP, mapunit is the foreign key to the -->
<!-- appropriate GeologicUnit -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gsml:specification
</targetAttribute>
<sourceExpression>
<OCQL>mapunit</OCQL>
<linkElement>gsml:GeologicUnit</linkElement>
<linkField>gml:name[2]</linkField>
</sourceExpression>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE SHAPE -->
<!-- From the shape field in source data -->
<!-- _____________________________________________ -->
<AttributeMapping>
<targetAttribute>
gsml:shape
</targetAttribute>
<sourceExpression>
<OCQL>shape</OCQL>
</sourceExpression>
</AttributeMapping>
<!-- _____________________________________________ -->
<!-- MAPPEDFEATURE METADATA -->
<!-- Unclear how to use this at present -->
<!-- _____________________________________________ -->
<!--<AttributeMapping>
<targetAttribute>
gsml:metadata
</targetAttribute>
<ClientProperty>
<name>xlink:href</name>
<value>'something'</value>
</ClientProperty>
</AttributeMapping>-->
</attributeMappings>
</FeatureTypeMapping>
</typeMappings>
- Login to post comments
Implementation Documents | Type | Applications | Description | Document # | Posted by | Update | Average Rating |
---|---|---|---|---|---|---|---|
GeoServer DataStore Configuration for Complex Features | Server | GeoServer | This XML file configures a directory as a DataStore in GeoServer. Instead of containing explicitly the information... | imp2009-003 | Ryan Clark | 09/03/2010 - 8:29am | |
GeoServer FeatureType Configuration | Server | GeoServer | This XML document tells GeoServer to treat a datastore as a featuretype -- that is, provide it as a featuretype that... | imp2009-006 | Ryan Clark | 09/18/2009 - 3:01pm |
Related Community Groups |
---|
Troubleshooting Web Service Deployment - Blog | 5 Posts | Join This blog is for documenting our group's experiences with web service deployment. |