Hi

We have just been testing the new GeoJSON output format for our complex 
app-schema services, which is really great and will allow us to plug in our 
data directly to web apps.


However we have noticed what is possibly a strange bug where if there are 
multiple gml:ReferenceTypes in a complex type and one of them is an unbounded 
reference. A snippet from our mapping file:


<AttributeMapping>
    
<targetAttribute>gsmlbh:indexData/gsmlbh:BoreholeDetails/gsmlbh:purpose</targetAttribute>
    <ClientProperty>
        <name>xlink:href</name>
        <value>purpose_href</value>
    </ClientProperty>
    <ClientProperty>
        <name>xlink:title</name>
        <value>purpose_title</value>
    </ClientProperty>
</AttributeMapping>
<AttributeMapping>
    
<targetAttribute>gsmlbh:indexData/gsmlbh:BoreholeDetails/gsmlbh:startPoint</targetAttribute>
    <ClientProperty>
        <name>xlink:href</name>
        <value>startpoint_href</value>
    </ClientProperty>
    <ClientProperty>
        <name>xlink:title</name>
        <value>startpoint_title</value>
    </ClientProperty>
</AttributeMapping>
<AttributeMapping>
    
<targetAttribute>gsmlbh:indexData/gsmlbh:BoreholeDetails/gsmlbh:inclinationType</targetAttribute>
    <targetAttributeNode>gml:ReferenceType</targetAttributeNode>
    <ClientProperty>
        <name>xlink:href</name>
        <value>inclinationtype_href</value>
    </ClientProperty>
    <ClientProperty>
        <name>xlink:title</name>
        <value>inclinationtype_title</value>
    </ClientProperty>
</AttributeMapping>

This produces the following GeoJSON output:


  *
purpose:
[
     *
{
        *
href: 
"http://resource.geoscience.gov.au/classifier/ga/boreholepurpose/stratigraphic_investigation";
},
     *
{
        *
title: "stratigraphic investigation"
},
     *
{
        *
href: "http://resource.geoscience.gov.au/classifier/ga/locationtype/onshore";
},
     *
{
        *
title: "onshore"
},
     *
{
        *
href: "http://resource.geoscience.gov.au/classifier/ga/inclinationtype/vertical";
},
     *
{
        *
title: "vertical"
}
]

We don't get inclinationType or startPoint, these are instead populated into an 
array of purpose.


I suspect the reason is that the gsmlbh:purpose element is an unbounded 
reference type, while the other two don't. So the GeoJSON encoder picks up the 
attribute mappings and populates gsmlbh:purpose with any gml:ReferenceType it 
finds in the mapping file


Relevant code in the XSD:


<element name="startPoint" type="gml:ReferenceType" nillable="true" 
minOccurs="0">
   <annotation>
      <documentation>The property startPoint:BoreholeStartPointCode provides a 
term from a controlled vocabulary indicating the named position relative to 
ground surface where the borehole commenced. (e.g., natural ground surface, 
open pit floor, underground, offshore)</documentation>
      <appinfo>
         <targetElement 
xmlns="http://www.opengis.net/gml/3.2";>gsmlbh:BoreholeStartPointCode</targetElement>
         <targetCodeList 
xmlns="http://www.opengis.net/gml/3.3/exr";>BoreholeStartPointCode</targetCodeList>
      </appinfo>
   </annotation>
</element>
<element name="inclinationType" type="gml:ReferenceType" nillable="true" 
minOccurs="0">
   <annotation>
      <documentation>The property inclinationType:BoreholeInclinationCode 
contains a term from a controlled vocabulary indicating the inclination type of 
the borehole. Appropriate terms would include vertical; inclined up; inclined 
down, horizontal.</documentation>
      <appinfo>
         <targetElement 
xmlns="http://www.opengis.net/gml/3.2";>gsmlbh:BoreholeInclinationCode</targetElement>
         <targetCodeList 
xmlns="http://www.opengis.net/gml/3.3/exr";>BoreholeInclinationCode</targetCodeList>
      </appinfo>
   </annotation>
</element>
<element name="boreholeMaterialCustodian" 
type="cit:CI_Responsibility_PropertyType" nillable="true" minOccurs="0" 
maxOccurs="unbounded">
   <annotation>
      <documentation>The property boreholeMaterialCustodian is an association 
between BoreholeDetails and a CIT:CI_ResponsibleParty describing the 
organisation that is custodian of the drilled material recovered from the 
borehole.</documentation>
   </annotation>
</element>
<element name="purpose" type="gml:ReferenceType" nillable="true" minOccurs="0" 
maxOccurs="unbounded">
   <annotation>
      <documentation>The property purpose:BoreholePurposeCode contains a term 
from a controlled vocabulary describing the purpose for which the borehole was 
drilled. e.g., site investigation, mineral exploration, hydrocarbon 
exploration, water resources.</documentation>
      <appinfo>
         <targetElement 
xmlns="http://www.opengis.net/gml/3.2";>gsmlbh:BoreholePurposeCode</targetElement>
         <targetCodeList 
xmlns="http://www.opengis.net/gml/3.3/exr";>BoreholePurposeCode</targetCodeList>
      </appinfo>
   </annotation>
</element>


http://schemas.opengis.net/gsml/4.1/borehole.xsd

schemas.opengis.net<http://schemas.opengis.net/gsml/4.1/borehole.xsd>
schemas.opengis.net
The GeoSciML Borehole package contains an information model for boreholes and 
related artefacts. This is primarily through re-use of standard components from 
the Observations and Measurements (ISO19156).

If I remove the maxOccurs="unbounded" from gsmlbh:purpose, I don't get the 
duplication.

Thanks


Michael Sexton
Resources Division Information Services | Resources Division

t +61 2 6249 9262    www.ga.gov.au<http://www.ga.gov.au/>

[cid:[email protected]]<http://www.ga.gov.au/>

[cid:[email protected]]<https://twitter.com/GeoscienceAus>[cid:[email protected]]<https://www.facebook.com/GeoscienceAustralia>[cid:[email protected]]<https://www.youtube.com/user/GeoscienceAustralia>[cid:[email protected]]<https://www.linkedin.com/company/geoscience-australia>


Geoscience Australia Disclaimer: This e-mail (and files transmitted with it) is 
intended only for the person or entity to which it is addressed. If you are not 
the intended recipient, then you have received this e-mail by mistake and any 
use, dissemination, forwarding, printing or copying of this e-mail and its file 
attachments is prohibited. The security of emails transmitted cannot be 
guaranteed; by forwarding or replying to this email, you acknowledge and accept 
these risks.
-------------------------------------------------------------------------------------------------------------------------

_______________________________________________
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


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to