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:
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”>
gml
http://www.opengis.net/gml/3.2
MyPrefix
MyURI
MyDataStore
dbtype
postgis
host
MyHost
port
MyPort
database
MyDatabaseName
user
MyUser
passwd
MyPassword
Expose primary keys
true
MySchemaURI
MyDataStore
depth_area
MyPrefix:DepthArea
MyPrefix:pk_id
pk_id
MyPrefix:depthrange
depth_range
geometry
geom
</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:extension base=“gml:AbstractFeatureType”>
<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”>
<MyPrefix:DepthArea gml:id=“depth_area.0”>
< MyPrefix:geometry/>
< MyPrefix:depthrange>200.0</ MyPrefix:depthrange>
</ MyPrefix:DepthArea>
</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 = = =