Hi list,
I am new !
I am working about WFS-T Insert request. My Datastore is a SHP file.
I wnat to send Insert request with a different profile. GeoServer by default uses "topp"
Namespace and uses dbf Attributes of the SHP in DescribeFeatureType and GetFeature
Responses.
First of all I have change "topp" with my prefix.
Than, I have written schema.xml with correct attributes I want to display in
DescribeFeatureType Response. Thi is the schema :
<xs:element name="FeatureCollection" type="wfs:FeatureCollectionType"
substitutionGroup="gml:_FeatureCollection"/>
<xs:complexType name="FeatureCollectionType">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureCollectionType">
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="esri2Type">
<xs:complexContent>
<xs:extension base="gml:AbstractFeatureType">
<xs:sequence>
<xs:element name="FID" type="integer"/>
<xs:element name="ID" type="double"/>
<xs:element name="GRIDCODE" type="double"/>
<xs:element name="_SHAPE_" type="gml:MultiPolygonPropertyType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Now, I am able to display right DescribeFeatureType Response with correct attributes. For
example I display "_SHAPE_ " attribute for geometry and not "the_geom".
I have built Insert Http Post Request following my Namespace and new attributes written in
schema.xml file to Insert feature in my SHP data store. This is the body of Request :
<wfs:Transaction service="WFS" version="1.0.0"
xmlns:wfs="http://www.esri.com/WFS"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.esri.com/WFS
http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=wfs:esri2"
<wfs:Insert>
<wfs:esri2>
<wfs:FID>0</wfs:FID>
<wfs:ID>1</wfs:ID>
<wfs:GRIDCODE>3</wfs:GRIDCODE>
<wfs:_SHAPE_>
<gml:MultiPolygon srsName="">
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>1676521.51262939,4835098.97
58958 1676524.93593872,4835111.16812602 1676533.70485962,4835102.39918605
1676521.51262939,4835098.9758958</gml:coordinates></gml:LinearRing></gml:outerBou
ndaryIs>
</gml:Polygon>
</gml:polygonMember>
</gml:MultiPolygon>
</wfs:_SHAPE_>
</wfs:esri2>
</wfs:Insert>
</wfs:Transaction>
The problem is :
I have an error because GeoServer doesn't know my new attributes (for example it isn't able
to know "_SHAPE_" attribute or "FID" attribute)
So I have done a GetFeature request and I have seen that GeoServer doesn't follow
schema.xml (so the GML output follows OLD attribute written in Dbf file).
I think I have to change some configuration for GetFeature Response in order to consider
also new attributes of my new Profile.
Is it right ?
What I have to do ?
Thank you !
********************************************************************************************
Ing. Fabio D'Ovidio
WebGIS Staff
Planetek Italia Srl
via Massaua, 12 - 70123 Bari - Italy
web : http ://www.planetek.it
e-mail : dovidio@anonymised.com
********************************************************************************************