Geoserver 2.21.1, AppSchema, PostGIS datastore
I have problems to implement attributes that have multiple values and nested attributes, and which are not a feature type. As long as I stick strictly to the "attributes with multiple values" examples in the documentation, everything works fine (which suggests that my setup works). But when I try to adapt the output to what is required for the example of swe:DataRecord (below), I either get only one attribute in return or none at all. Below is what I want to achieve and one of my attempts. Is it possible at all? And if yes, what is the correct approach?
Thanks in advance for any help.
Henning
----------------------
I have two tables in my PostGIS database:
- geologylogs contains information and data of individual logs
- geologylogfields contains the fields that are present in each of the logs (1:n relationship to geologylogs via FK):
This should be mapped to the following output, where swe:DataRecord is the feature (source table geologylogfields) that is (successfully) chained from gwml2w:GW_GeologyLog (source table geologylogs). Each swe:DataRecord has one to many occurrences of swe:field (like feature chaining, but without the feature type):
id (PK)
logid (FK to geologylogs)
name (name of the field, e.g. 'lithology', 'colour', ...) definition (short explanation of the name) url (points to vocabulary entry for name) 1
log1
nameA
definitionA
urlA
2
log1
nameB
definitionB
urlB
3
log1
nameC
definitionC
urlC
...
<swe:DataRecord id="SD-5054_1_A-geollog-datarecord">
<swe:field name="nameA">
<swe:Category definition="urlA">
<swe:description>definitionA</swe:description>
</swe:Category>
</swe:field>
<swe:field name="nameB">
<swe:Category definition="urlB">
<swe:description>definitionB</swe:description>
</swe:Category>
</swe:field>
<swe:field name="nameC">
<swe:Category definition="urlC">
<swe:description>definitionB</swe:description>
</swe:Category>
</swe:field>
And the mapping file of one attempt, which produces a total of one <swe:field> instead of one <swe:field> for each entry that is related to the parent log. If I only use the AttributeMapping with the isMultiple true statement, I don't get a swe:field at
all (probably because not all required elements are present).
<FeatureTypeMapping>
<sourceDataStore>datastore</sourceDataStore>
<sourceType>geologylogfields</sourceType>
<targetElement>swe:DataRecord</targetElement>
<attributeMappings>
<AttributeMapping>
<targetAttribute>FEATURE_LINK</targetAttribute>
<sourceExpression>
<OCQL>logid</OCQL>
</sourceExpression>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>swe:DataRecord</targetAttribute>
<idExpression>
<OCQL>Concatenate('SD-', logid, '-geollog-datarecord')</OCQL>
</idExpression>
<ClientProperty>
<name>definition</name>
<value>'http://www.opengis.net/def/gwml/2.0/coverage/geologyLog'</value>
</ClientProperty>
</AttributeMapping>
<!-- THE PART THAT SHOULD BE MULTIPLE: -->
<AttributeMapping>
<targetAttribute>swe:field</targetAttribute>
<ClientProperty>
<name>name</name>
<value>name</value>
</ClientProperty>
<isMultiple>true</isMultiple>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>swe:field/swe:Category</targetAttribute>
<ClientProperty>
<name>definition</name>
<value>url</value>
</ClientProperty>
</AttributeMapping>
<AttributeMapping>
<targetAttribute>swe:field/swe:Category/swe:description</targetAttribute>
<sourceExpression>
<OCQL>definition</OCQL>
</sourceExpression>
</AttributeMapping>
När du har kontakt med oss på Uppsala universitet med e-post så innebär det att vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/
E-mailing Uppsala University means that we will process your personal data. For more information on how this is performed, please read here: http://www.uu.se/en/about-uu/data-protection-policy
_______________________________________________ Geoserver-users mailing list
Please make sure you read the following two resources before posting to this list: - Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/ - The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users