[Geoserver-users] wfs:Update => Updating only geom of a designed feature using FID => ERROR: syntax error at or near "WHERE"

Hi again,
I'm trying to update the geom of a feature object with POST. But
geoserver doesn't update the geom due to a db connection error (Its a
postgis DB latest stable).
Im using GeoServer NightyBuild "geoserver-1.5.x-071707-bin"

Am i doing something wrong or is it a bug?
If you need more details/schema/shapefile/etc just ask :wink:

Thanks for the great job done in this community.

--Jeremy

Here the POST Content (Removed some points inside):
// --------- START ----------
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS"
version="1.0.0" xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:icia="http://www.test.com/icia&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
<wfs:Update wfs:typeName="icia:batiment_prive">
<ogc:Filter>
  <ogc:FeatureId fid="batiment_prive.276"/>
</ogc:Filter>
<the_geom>
  <gml:MultiPolygon srsName="http://www.opengis.net/gml/srs/epsg.xml#27592&quot;&gt;
    <gml:polygonMember>
      <gml:Polygon>
        <gml:outerBoundaryIs>
          <gml:LinearRing>
            <gml:coordinates>-1022589.92,-7819210
-1024089.26,-7820992.060000001 -1022589.92,-7819210 </gml:coordinates>
          </gml:LinearRing>
        </gml:outerBoundaryIs>
      </gml:Polygon>
    </gml:polygonMember>
  </gml:MultiPolygon>
</the_geom>
</wfs:Update>
</wfs:Transaction>
// --------- END ----------

The geom type of my feature is "gml:MultiPolygonPropertyType" so it
seems correct to me.

The response of geoserver is:
// --------- START ----------
<wfs:WFS_TransactionResponse version="1.0.0"
xmlns:wfs="http://www.opengis.net/wfs&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
xsi:schemaLocation="http://www.opengis.net/wfs
http://xxx.xxx.xxx.xxx:8080/geoserver/schemas/wfs/1.0.0/WFS-transaction.xsd&quot;&gt;
<wfs:TransactionResult> <wfs:Status> <wfs:FAILED/> </wfs:Status>
<wfs:Message>Some sort of database connection error: ERROR: syntax
error at or near &quot;WHERE&quot;</wfs:Message>
</wfs:TransactionResult></wfs:WFS_TransactionResponse>
// --------- END ----------

Here last lines of the log talking about the error:
// --------- START ----------
FINER: encoded modify is UPDATE "public"."batiment_prive" SET WHERE
("gid" = '276');
Jul 19, 2007 11:54:41 AM org.geotools.filter.FidFilterImpl equals
FINEST: condition: [ batiment_prive.276 ]
Jul 19, 2007 11:54:41 AM org.geotools.filter.FidFilterImpl equals
FINEST: condition: 22
Jul 19, 2007 11:54:41 AM AbstractFilter isLogicFilter
FINER: ENTRY 22
Jul 19, 2007 11:54:41 AM org.geotools.filter.SQLEncoder visit
FINER: Exporting FID=[batiment_prive.276]
Jul 19, 2007 11:54:41 AM org.geotools.data.postgis.PostgisFeatureStore
getEnvelope
FINE: SQL: SELECT AsText(force_2d(Envelope(Extent("the_geom")))) FROM
"public"."batiment_prive" WHERE ("gid" = '276')
Jul 19, 2007 11:54:41 AM org.geotools.data.postgis.PostgisFeatureStore bounds
FINER: returning bounds Env[8.4876752E7 : 8.4879768E7, -7819432.0 : -7813849.0]
Jul 19, 2007 11:54:41 AM org.geotools.data.postgis.PostgisFeatureStore
modifyFeatures
WARNING: Some sort of database connection error: ERROR: syntax error
at or near "WHERE"
Jul 19, 2007 11:54:41 AM org.vfny.geoserver.servlets.AbstractService doService
FINER: execution succeed
Jul 19, 2007 11:54:41 AM org.vfny.geoserver.servlets.AbstractService doService
FINEST: getting strategy output
Jul 19, 2007 11:54:41 AM org.vfny.geoserver.servlets.AbstractService doService
FINER: strategy output is: java.io.BufferedOutputStream
Jul 19, 2007 11:54:41 AM org.vfny.geoserver.servlets.AbstractService doService
FINE: mime type is: text/xml; charset=UTF-8
Jul 19, 2007 11:54:41 AM
org.geotools.data.jdbc.ConnectionPool$ConnectionListManager
connectionClosed
FINE: Connection closed - adding to available connections.
Jul 19, 2007 11:54:41 AM org.vfny.geoserver.servlets.AbstractService doService
INFO: Service handled
// --------- END ----------

Jeremy DERRAC ha scritto:

Hi again,
I'm trying to update the geom of a feature object with POST. But
geoserver doesn't update the geom due to a db connection error (Its a
postgis DB latest stable).
Im using GeoServer NightyBuild "geoserver-1.5.x-071707-bin"

Am i doing something wrong or is it a bug?
If you need more details/schema/shapefile/etc just ask :wink:

Thanks for the great job done in this community.

--Jeremy

Here the POST Content (Removed some points inside):
// --------- START ----------
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS"
version="1.0.0" xmlns:gml="http://www.opengis.net/gml&quot;
xmlns:icia="http://www.test.com/icia&quot;
xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
<wfs:Update wfs:typeName="icia:batiment_prive">
<ogc:Filter>
  <ogc:FeatureId fid="batiment_prive.276"/>
</ogc:Filter>
<the_geom>
  <gml:MultiPolygon srsName="http://www.opengis.net/gml/srs/epsg.xml#27592&quot;&gt;
    <gml:polygonMember>
      <gml:Polygon>
        <gml:outerBoundaryIs>
          <gml:LinearRing>
            <gml:coordinates>-1022589.92,-7819210
-1024089.26,-7820992.060000001 -1022589.92,-7819210 </gml:coordinates>
          </gml:LinearRing>
        </gml:outerBoundaryIs>
      </gml:Polygon>
    </gml:polygonMember>
  </gml:MultiPolygon>
</the_geom>
</wfs:Update>
</wfs:Transaction>

This update is completely wrong, structure wise. I'm surprise it's being
parsed without issues in fact...

If you look in the sample requests page (Geoserver, demo section)
there is a good one:
<wfs:Transaction service="WFS" version="1.0.0"
   xmlns:topp="http://www.openplans.org/topp&quot;
   xmlns:ogc="http://www.opengis.net/ogc&quot;
   xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;
   <wfs:Update typeName="topp:tasmania_roads">
     <wfs:Property>
       <wfs:Name>TYPE</wfs:Name>
       <wfs:Value>street</wfs:Value>
     </wfs:Property>
     <ogc:Filter>
       <ogc:FeatureId fid="tasmania_roads.1"/>
     </ogc:Filter>
   </wfs:Update>
</wfs:Transaction>

Hope this helps
Cheers
Andrea

I feel stupid...
Sorry for taking your time for this
Thanks for the Faaaaaaaaaast answer :wink:

-- Jeremy

2007/7/19, Andrea Aime <aaime@anonymised.com>:

Jeremy DERRAC ha scritto:
> Hi again,
> I'm trying to update the geom of a feature object with POST. But
> geoserver doesn't update the geom due to a db connection error (Its a
> postgis DB latest stable).
> Im using GeoServer NightyBuild "geoserver-1.5.x-071707-bin"
>
> Am i doing something wrong or is it a bug?
> If you need more details/schema/shapefile/etc just ask :wink:
>
> Thanks for the great job done in this community.
>
> --Jeremy
>
> Here the POST Content (Removed some points inside):
> // --------- START ----------
> <wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs&quot; service="WFS"
> version="1.0.0" xmlns:gml="http://www.opengis.net/gml&quot;
> xmlns:icia="http://www.test.com/icia&quot;
> xmlns:ogc="http://www.opengis.net/ogc&quot;
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
> <wfs:Update wfs:typeName="icia:batiment_prive">
> <ogc:Filter>
> <ogc:FeatureId fid="batiment_prive.276"/>
> </ogc:Filter>
> <the_geom>
> <gml:MultiPolygon srsName="http://www.opengis.net/gml/srs/epsg.xml#27592&quot;&gt;
> <gml:polygonMember>
> <gml:Polygon>
> <gml:outerBoundaryIs>
> <gml:LinearRing>
> <gml:coordinates>-1022589.92,-7819210
> -1024089.26,-7820992.060000001 -1022589.92,-7819210 </gml:coordinates>
> </gml:LinearRing>
> </gml:outerBoundaryIs>
> </gml:Polygon>
> </gml:polygonMember>
> </gml:MultiPolygon>
> </the_geom>
> </wfs:Update>
> </wfs:Transaction>

This update is completely wrong, structure wise. I'm surprise it's being
parsed without issues in fact...

If you look in the sample requests page (Geoserver, demo section)
there is a good one:
<wfs:Transaction service="WFS" version="1.0.0"
   xmlns:topp="http://www.openplans.org/topp&quot;
   xmlns:ogc="http://www.opengis.net/ogc&quot;
   xmlns:wfs="http://www.opengis.net/wfs&quot;&gt;
   <wfs:Update typeName="topp:tasmania_roads">
     <wfs:Property>
       <wfs:Name>TYPE</wfs:Name>
       <wfs:Value>street</wfs:Value>
     </wfs:Property>
     <ogc:Filter>
       <ogc:FeatureId fid="tasmania_roads.1"/>
     </ogc:Filter>
   </wfs:Update>
</wfs:Transaction>

Hope this helps
Cheers
Andrea