Hello list.
I'm trying to creating a GML data model and I want to put it into GeoServer, backed by a PostGIS database.
My XML Schema file is as follow:
<xs:complexType name = "gmlfeature2_Type" >
<xs:complexContent>
<xs:extension base = "gml:AbstractFeatureType" >
<xs:sequence>
<xs:element ref="gml:extentOf" minOccurs="1" maxOccurs="1"></xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
As per GeoServer documentation, I put this text in a schema.xml file into the proper directory in the GeoServer installation (installed with the war file into Tomcat 5.5, linux box - version 1.3.2). I'm confident the info.xml is correct (I modified a generated one).
I can get a correct WFSDescribeFeatureType response from GeoServer.
I created the corresponding PostGIS table:
CREATE TABLE "public"."gmlfeature2" (
"fid" VARCHAR NOT NULL,
"name" VARCHAR,
"description" VARCHAR,
"boundedBy" "public"."geometry",
"extentOf" "public"."geometry",
CONSTRAINT "gmlfeature2_pkey" PRIMARY KEY("fid")
[...] (I omitted spatial PostGIS constraints)
) WITHOUT OIDS;
I successfully loaded some features into the table with some SQL INSERT.
But when I query GeoServer (with a simple WFSGetFeature request), I get what seems to me a bad GML document. A single feature from the response is this (ddm is my own namespace's prefix):
<ddm:gmlfeature2 fid="gmlfeature2.0">
<ddm:name>MyName</ddm:name>
<ddm:description>MyDesc</ddm:description>
<ddm:extentOf>
<gml:Polygon srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">-20,20 20,20 20,-20 -20,-20 -20,20</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ddm:extentOf>
</ddm:gmlfeature2>
I think it's bad because it puts every feature's attribute in my own namespace (ddm), but all those attributes (name, description) are from the standard GML 2 Schema, inherited from the base type AbstractFeatureType. extentOf is a GML-defined element, and as such it should be prefixed by "gml:", not by my own prefix "ddm:" (which doesn't define such element).
Am I right? Is there something I'm missing? Or this is a GeoServer behaviour and a GML data modeler *has* to design his/her data model with only custom attributes (all from the application namespace)?
Thanks in advance for any feedback.
Best regards,
Fabio Da Soghe