Ryan,

WFS 1.1.0 defaults to GML 3.1.1 output; you cannot return GML 3.2.1 
content unless you use outputformat=gml32 or use WFS 2.0.0. I see you 
noticed this in a later email.
http://docs.geoserver.org/latest/en/user/data/app-schema/supported-gml-versions.html

This looks like a secondary namespace problem, as you note.

Also, your mapping for pk_id is invalid as gml:id cannot be an integer; 
they must be XML NCNames. Furthermore, just use sourceExpression if you 
want this to be an ordinary property. This is unrelated to the geometry 
problem.

Kind regards,
Ben.

On 17/09/13 19:50, Ryan Moody wrote:
> Hello,
>
> I’d be extremely grateful if someone could help me with a GeoServer
> App-Schema issue that I’ve been battling to no avail!
>
> I’m attempting to use the GeoServer App-Schema extension to map the
> geometry and attribution stored in a data table of a PostGIS database to
> a GMLAS.
>
> My PostGIS data table ‘depth_area’ contains three columns: ‘pk_id’,
> ‘depth_range’ and ‘geom’. I have registered the geometry column via the
> AddGeometryColumn function and have confirmed that this column contains
> valid geometry (polygons).
>
> I have defined the app-schema mapping file and GMLAS as shown below. I
> have checked that both are valid in an XML Editor.
>
> On starting GeoServer, my workspace loads without errors. When GeoServer
> is running, I make the following WFS request:
>
> http://localhost:8080/geoserver/MyPrefix/ows?service=WFS&version=1.1.0&request=GetFeature&typeName=MyPrefix:DepthArea&maxFeatures=2
>
> This returns me a valid response (bottom of this email), and the
> depth_range values are being successfully mapped across from the PostGIS
> database. However, the geometry element is empty:
>
> < MyPrefix:geometry/>
>
> Can anyone suggest where I may be going wrong, looking at my
> configuration below?
>
> Best regards,
>
> Ryan
>
> = = = Begin App-Schema 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>gml</prefix>
>
>
> <uri>http://www.opengis.net/gml/3.2</uri>
>
>                                  </Namespace>
>
>                                  <Namespace>
>
>                                                  <prefix>MyPrefix</prefix>
>
>                                                  <uri>MyURI</uri>
>
>                                  </Namespace>
>
>                  </namespaces>
>
>                  <sourceDataStores>
>
>                                  <DataStore>
>
>                                                  <id>MyDataStore</id>
>
>                                                  <parameters>
>
>                                                                  <Parameter>
>
>                                                                               
>    <name>dbtype</name>
>
>                                                                               
>    <value>postgis</value>
>
>
> </Parameter>
>
>                                                                  <Parameter>
>
>                                                                               
>    <name>host</name>
>
>                                                                               
>    <value>MyHost</value>
>
>
> </Parameter>
>
>                                                                  <Parameter>
>
>                                                                               
>    <name>port</name>
>
>                                                                               
>    <value>MyPort</value>
>
>
> </Parameter>
>
>                                                                  <Parameter>
>
>                                                                               
>    <name>database</name>
>
>                                                                               
>    <value>MyDatabaseName</value>
>
>
> </Parameter>
>
>                                                                  <Parameter>
>
>                                                                               
>    <name>user</name>
>
>                                                                               
>    <value>MyUser</value>
>
>
> </Parameter>
>
>                                                                  <Parameter>
>
>                                                                               
>    <name>passwd</name>
>
>                                                                               
>    <value>MyPassword</value>
>
>
> </Parameter>
>
>                                                                  <Parameter>
>
>                                                                               
>    <name>Expose primary keys</name>
>
>                                                                               
>    <value>true</value>
>
>
> </Parameter>
>
>                                                  </parameters>
>
>                                  </DataStore>
>
>                  </sourceDataStores>
>
>                  <targetTypes>
>
>                                  <FeatureType>
>
>
> <schemaUri>MySchemaURI</schemaUri>
>
>                                  </FeatureType>
>
>                  </targetTypes>
>
>                  <typeMappings>
>
>                                  <FeatureTypeMapping>
>
>
> <sourceDataStore>MyDataStore</sourceDataStore>
>
>
> <sourceType>depth_area</sourceType>
>
>
> <targetElement>MyPrefix:DepthArea</targetElement>
>
>                                                  <attributeMappings>
>
>
> <AttributeMapping>
>
>                                                                               
>    <targetAttribute>MyPrefix:pk_id</targetAttribute>
>
>                                                                               
>    <idExpression>
>
>                                                                               
>                    <OCQL>pk_id</OCQL>
>
>                                                                               
>    </idExpression>
>
>
> </AttributeMapping>
>
>
> <AttributeMapping>
>
>                                                                               
>    <targetAttribute>MyPrefix:depthrange</targetAttribute>
>
>                                                                               
>    <sourceExpression>
>
>                                                                               
>                    <OCQL>depth_range</OCQL>
>
>                                                                               
>    </sourceExpression>
>
>
> </AttributeMapping>
>
>
> <AttributeMapping>
>
>                                                                               
>    <targetAttribute>geometry</targetAttribute>
>
>                                                                               
>    <sourceExpression>
>
>                                                                               
>                    <OCQL>geom</OCQL>
>
>                                                                               
>    </sourceExpression>
>
>
> </AttributeMapping>
>
>                                                  </attributeMappings>
>
>                                  </FeatureTypeMapping>
>
>                  </typeMappings>
>
> </as:AppSchemaDataAccess>
>
> = = = End App-Schema Mapping File = = =
>
> = = = Begin GML Application Schema = = =
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> xmlns:MyPrefix="MyURI" xmlns:gml="http://www.opengis.net/gml/3.2";
> targetNamespace="MyURI" elementFormDefault="qualified">
>
>                  <xs:import namespace="http://www.opengis.net/gml/3.2";
> schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/>
>
>                  <xs:element name="DepthArea"
> type="MyPrefix:DepthAreaType" substitutionGroup="gml:AbstractFeature"/>
>
>                  <xs:complexType name="DepthAreaType">
>
>                                  <xs:complexContent>
>
>                                                  <xs:extension
> base="gml:AbstractFeatureType">
>
>
> <xs:sequence>
>
>                                                                               
>    <xs:element name="pk_id" type="xs:integer"/>
>
>                                                                               
>    <xs:element name="geometry" type="gml:SurfacePropertyType"/>
>
>                                                                               
>    <xs:element name="depthrange" type="xs:float"/>
>
>
> </xs:sequence>
>
>                                                  </xs:extension>
>
>                                  </xs:complexContent>
>
>                  </xs:complexType>
>
> </xs:schema>
>
> = = = End GML Application Schema = = =
>
> = = = Begin WFS Request Response = = =
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs";
> xmlns:ogc="http://www.opengis.net/ogc";
> xmlns:gml="http://www.opengis.net/gml";
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xmlns:MyPrefix="MyURI" xmlns:xlink="http://www.w3.org/1999/xlink";
> xmlns:ows="http://www.opengis.net/ows"; numberOfFeatures="2"
> timeStamp="2013-09-17T11:20:53.174Z"
> xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd MyURI MyGMLAS.xsd">
>
>                  <gml:featureMember>
>
>                                  <MyPrefix:DepthArea gml:id="depth_area.0">
>
>                                                  < MyPrefix:geometry/>
>
>                                                  <
> MyPrefix:depthrange>200.0</ MyPrefix:depthrange>
>
>                                  </ MyPrefix:DepthArea>
>
>                  </gml:featureMember>
>
>                  <gml:featureMember>
>
>                                  < MyPrefix:DepthArea gml:id="depth_area.1">
>
>                                                  < MyPrefix:geometry/>
>
>                                                  <
> MyPrefix:depthrange>0.0</ MyPrefix:depthrange>
>
>                                  </ MyPrefix:DepthArea>
>
>                  </gml:featureMember>
>
> </wfs:FeatureCollection>
>
> = = = End WFS Request Response = = =
>
>
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

-- 
Ben Caradoc-Davies <[email protected]>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to