[Geoserver-devel] 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

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

Fabio D'Ovidio ha scritto:

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.

Nope, the user interface does not support renaming attribute exactly
because we don't support this. You should not modify those files.

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)

Yeah, indeed, because it keeps using what's really inside the shapefile.
The contents of schema.xml are largely ignored... I'm a little new to
Geoserver and I don't exactly know what we are using schema.xml for,
feature type wise, but I know we don't have type/attribute name aliasing.

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.

No, to make this work I guess you have to modify the geoserver code in
order to work with aliases, and it's not a trivial change, althought
it's not the first time I hear this request in the last few days.

Btw, I hope you just wanted to have different names for attributes,
if you want to hide attributes it's more complicated, and for new
attributes, even more, because that would require changing the shapefile
datastore as well.

Cheers
Andrea Aime

On 6 Nov 2006 at 12:41, Andrea Aime wrote:

Fabio D’Ovidio ha scritto:

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.

Nope, the user interface does not support renaming attribute exactly
because we don’t support this. You should not modify those files.

I was able to change DescribeFeatureType Response. This is :

<?xml version="1.0" encoding="UTF-8" ?>

<xs:import namespace=“http://www.opengis.net/gml” schemaLocation=“http://localhost:8080/geoserver/schemas/gml/2.1.2/feature.xsd” />

<xs:element name=“FeatureCollection” type=“wfs:FeatureCollectionType” substitutionGroup=“gml:_FeatureCollection” />

<xs:extension base=“gml:AbstractFeatureCollectionType” />

</xs:complexContent>

</xs:complexType>

<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>

<xs:element name=“esri2” type=“wfs:esri2_Type” substitutionGroup=“gml:_Feature” />

</xs:schema>

That is different from the attributes in the dbf file.

The problem is on the Insert Request.


graphic

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


(attachments)

planetek.gif

Fabio D'Ovidio ha scritto:

On 6 Nov 2006 at 12:41, Andrea Aime wrote:

Fabio D'Ovidio ha scritto:
> 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.

Nope, the user interface does not support renaming attribute exactly
because we don't support this. You should not modify those files.

I was able to change DescribeFeatureType Response.

This does not mean Geoserver is designed to act as you'd like to...
it may just be that you've found a single place where schema.xml is
used instead of the actual feature type, whilst the rest just ignores it.

Anyways, in a couple of hours developers with more geoserver experience
will wake up, let's see if the kind of aliasing you're looking after
is supported by Geoserver (if so, you've found a bug) or if you're
looking for a missing feature.

Cheers
Andrea

Hi Fabio:

This is the kind of thing handled on the complex-features branch (or community schema branch). You get to specify your schema, and then define a mapping from your datasource to that schema.

Jody

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-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel