[Geoserver-users] WFS-T : Insert feature with different Schema

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&quot;
   xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.esri.com/WFS
http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=wfs:esri2&quot;

  <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

********************************************************************************************

Hi Fabio,

I will answer part of your question now, the rest later (if I can).

To change the prefix from 'topp' to your own, you have to navigate to the config->data->namespace page in the web admin interface. There you can create your own namespace. Next, go to your feature type configuration page and set the namespace of the feature type to use your new one.

Brent Owens
(The Open Planning Project)

Fabio D'Ovidio wrote:

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&quot; xmlns:gml="http://www.opengis.net/gml&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation="http://www.esri.com/WFS http://localhost:8080/geoserver/wfs/DescribeFeatureType?typeName=wfs:esri2&quot;
  
   <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

********************************************************************************************

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users