[Geoserver-users] WFS Transaction Update Geom.

Hi ppl,

Can anyone help me on this? I’ve a MySQL database with a table ‘coord’ with 3 fields (id [integer][key], pts [geom], treta [varchar]). I create a DataStore and a FeatureType in geoserver to handle with that table.

Now when I go to demo page to get some xml requests, I cannot UPDATE values to my geom field, why?

This requests work:

<wfs:Transaction service=“WFS” version=“1.0.0”

xmlns:topp=“http://www.openplans.org/topp

xmlns:ogc=“http://www.opengis.net/ogc

xmlns:wfs=“http://www.opengis.net/wfs

xmlns:gml=“http://www.opengis.net/gml”>

<wfs:Update typeName=“topp:coord”>

wfs:Property

wfs:Nametreta</wfs:Name>

wfs:ValueLocal 2</wfs:Value>

</wfs:Property>

ogc:Filter

<ogc:FeatureId fid=“coord.10000004”/>

</ogc:Filter>

</wfs:Update>

</wfs:Transaction>

But this one don’t work:

<wfs:Transaction service=“WFS” version=“1.0.0”

xmlns:topp=“http://www.openplans.org/topp

xmlns:ogc=“http://www.opengis.net/ogc

xmlns:wfs=“http://www.opengis.net/wfs

xmlns:gml=“http://www.opengis.net/gml”>

<wfs:Update typeName=“topp:coord”>

wfs:Property

wfs:Namepts</wfs:Name>

wfs:Value

<gml:Point srsName=“http://www.opengis.net/gml/srs/epsg.xml#27354”>

gml:coordinates-1234,189000</gml:coordinates>

</gml:Point>

</wfs:Value>

</wfs:Property>

ogc:Filter

<ogc:FeatureId fid=“coord.10000004”/>

</ogc:Filter>

</wfs:Update>

</wfs:Transaction>

Here is the result:

<wfs:WFS_TransactionResponse version=“1.0.0” xsi:schemaLocation=“http://www.opengis.net/wfs http://localhost:8888/geoserver/data/capabilities/wfs/1.0.0/WFS-transaction.xsd”>

wfs:TransactionResult

wfs:Status

wfs:FAILED/

</wfs:Status>

wfs:MessageFeature writer already closed</wfs:Message>

</wfs:TransactionResult>

</wfs:WFS_TransactionResponse>

Why?

Best regards,

Nuno André de Sampaio Faria
Laboratório SIG (1.05)
Dep. Informática, Universidade do Minho
4710-057 Gualtar, Braga
Portugal

Tel: +351 253 604457

Web: http://www.nasf.cjb.net/

I suspect it may be because the MySQL geometry support is not implemented
on their InnoDB tables, which have full transaction acid support. Instead
they are on the older mysql tables, which don't support updates nearly as
well. I'm not 100% sure this is the reason, I'm mostly parroting what
others have said in the past. But there are issues with updating
geometries in mysql.

But I do feel like I have done updates against geometries, but I may be
wrong, it may have been only inserts? If you turn on 'Verbose Exceptions'
in Config -> Server it should give us a better error report.

Chris

On Fri, 6 May 2005, Nuno Faria wrote:

Hi ppl,

Can anyone help me on this? I’ve a MySQL database with a table ‘coord’ with
3 fields (id [integer][key], pts [geom], treta [varchar]). I create a
DataStore and a FeatureType in geoserver to handle with that table.

Now when I go to demo page to get some xml requests, I cannot UPDATE values
to my geom field, why?

This requests work:

<!-- INSERT -->

<wfs:Transaction service="WFS" version="1.0.0"

  xmlns:wfs="http://www.opengis.net/wfs&quot;

  xmlns:topp="http://www.openplans.org/topp&quot;

  xmlns:gml="http://www.opengis.net/gml&quot;

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

  xsi:schemaLocation="http://www.openplans.org/topp
http://localhost:8888/geoserver/wfs/DescribeFeatureType?typeName=topp:coord&quot;

>

  <wfs:Insert>

    <topp:coord>

      <topp:pts>

        <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#27354&quot;&gt;

              <gml:coordinates decimal="." cs="," ts="
">10,180000</gml:coordinates>

        </gml:Point>

      </topp:pts>

      <topp:treta>Local 1</topp:treta>

    </topp:coord>

  </wfs:Insert>

</wfs:Transaction>

<!-- UPDATE -->

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

  xmlns:gml="http://www.opengis.net/gml&quot;&gt;

  <wfs:Update typeName="topp:coord">

    <wfs:Property>

      <wfs:Name>treta</wfs:Name>

      <wfs:Value>Local 2</wfs:Value>

    </wfs:Property>

    <ogc:Filter>

      <ogc:FeatureId fid="coord.10000004"/>

    </ogc:Filter>

  </wfs:Update>

</wfs:Transaction>

But this one don’t work:

<!-- UPDATE -->

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

  xmlns:gml="http://www.opengis.net/gml&quot;&gt;

  <wfs:Update typeName="topp:coord">

    <wfs:Property>

      <wfs:Name>pts</wfs:Name>

      <wfs:Value>

        <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#27354&quot;&gt;

            <gml:coordinates>-1234,189000</gml:coordinates>

        </gml:Point>

      </wfs:Value>

    </wfs:Property>

    <ogc:Filter>

      <ogc:FeatureId fid="coord.10000004"/>

    </ogc:Filter>

  </wfs:Update>

</wfs:Transaction>

Here is the result:

<wfs:WFS_TransactionResponse version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/wfs
http://localhost:8888/geoserver/data/capabilities/wfs/1.0.0/WFS-transaction.
xsd">

<wfs:TransactionResult>

<wfs:Status>

<wfs:FAILED/>

</wfs:Status>

<wfs:Message>Feature writer already closed</wfs:Message>

</wfs:TransactionResult>

</wfs:WFS_TransactionResponse>

Why?

Best regards,

Nuno André de Sampaio Faria
Laboratório SIG (1.05)
Dep. Informática, Universidade do Minho
4710-057 Gualtar, Braga
Portugal

Tel: +351 253 604457

Web: <http://www.nasf.cjb.net/&gt; http://www.nasf.cjb.net/

--

Hi Chris,

I turn on 'Verbose Exceptions' and here is the error report:

147612 [FINE] org.vfny.geoserver.servlets.AbstractService - ------------XML
POST START-----------
<!-- UPDATE ???-->
<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;
  xmlns:gml="http://www.opengis.net/gml&quot;&gt;
  <wfs:Update typeName="topp:coord">
    <wfs:Property>
      <wfs:Name>pts</wfs:Name>
      <wfs:Value>
        <gml:Point srsName="http://www.opengis.net/gml/srs/epsg.xml#27345&quot;&gt;
            <gml:coordinates>6969,696969</gml:coordinates>
        </gml:Point>
      </wfs:Value>
    </wfs:Property>
    <ogc:Filter>
      <ogc:FeatureId fid="coord.112123"/>
    </ogc:Filter>
  </wfs:Update>
</wfs:Transaction>
------------XML POST END-----------
148053 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
148063 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
148063 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
148063 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
148063 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
148063 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
148093 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
148093 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
150487 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
150497 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
150527 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
150527 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
150547 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
150547 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
150547 [FINE] org.vfny.geoserver.wfs.requests.TransactionFeatureHandler -
we are inside attribute: false, curAttType is null curFeatureT: null attName
150597 [INFO] org.vfny.geoserver.servlets.AbstractService - handling
request: Lock Id: null
releaseAction: ALL
handle: null
TypeName: topp:coord
handle: null topp:coord 1
ReleaseAll: true
filter: [ coord.112123 ]
Property - Name: pts, Value: POINT (6969 696969)

150597 [FINE] org.vfny.geoserver.servlets.AbstractService - strategy is:
org.vfny.geoserver.servlets.FileStrategy@anonymised.com
150707 [FINE] org.vfny.geoserver.wfs.responses.TransactionResponse -
request is Lock Id: null
releaseAction: ALL
handle: null
TypeName: topp:coord
handle: null topp:coord 1
ReleaseAll: true
filter: [ coord.112123 ]
Property - Name: pts, Value: POINT (6969 696969)

150727 [FINE] org.vfny.geoserver.wfs.responses.TransactionResponse -
Locating FeatureSource 'topp:coord'...
150727 [FINE] org.vfny.geoserver.global.Data - getting type topp:coord
150727 [FINE] org.vfny.geoserver.wfs.responses.TransactionResponse -
located FeatureType w/ typeRef 'RecursosPts:coord' and elementName
'topp:coord'
150967 [FINE] org.geotools.data.jdbc.JDBCDataStore - calling sql builder
with filter [ coord.112123 ]
150997 [FINE] org.geotools.data.jdbc.JDBCDataStore - sql is SELECT id,
AsText(pts) AS pts, treta FROM coord WHERE (id = '112123')
150997 [FINE] org.geotools.data.jdbc.JDBCDataStore - About to execute
query: SELECT id, AsText(pts) AS pts, treta FROM coord WHERE (id = '112123')
150997 [FINE] org.geotools.data.jdbc.ConnectionPool - Getting available
connection.
151087 [FINE] org.geotools.data.jdbc.JDBCDataStore - getting feature writer
for coord: typeName = coord schema: DefaultFeatureType [name=coord ,
namespace=http://www.opengis.net/gml , abstract=false ,
types=(DefaultAttributeType [name=pts , type=class
com.vividsolutions.jts.geom.Geometry , nillable=true, min=1,
max=1],DefaultAttributeType [name=treta , type=class java.lang.String ,
nillable=true, min=1, max=1],)]srids: {pts=-1}
151118 [FINE] org.geotools.data.jdbc.JDBCDataStore - calling sql builder
with filter [ coord.112123 ]
151118 [FINE] org.geotools.data.jdbc.JDBCDataStore - sql is SELECT id,
AsText(pts) AS pts, treta FROM coord WHERE (id = '112123')
151118 [FINE] org.geotools.data.jdbc.JDBCDataStore - About to execute
query: SELECT id, AsText(pts) AS pts, treta FROM coord WHERE (id = '112123')
151128 [FINE] org.geotools.data.mysql.MySQLDataStore - returning jdbc
feature writer
151168 [FINE] org.geotools.data.jdbc.JDBCFeatureWriter - write called, live
is Feature[ id=coord.112123 , pts=POINT (-33333 186774) , treta=trofa3 ] and
cur is Feature[ id=coord.112123 , pts=POINT (6969 696969) , treta=trofa3 ]
151168 [FINE] org.geotools.data.jdbc.JDBCTextFeatureWriter - updating
postgis feature Feature[ id=coord.112123 , pts=POINT (6969 696969) ,
treta=trofa3 ]
151208 [FINE] org.geotools.data.jdbc.JDBCTextFeatureWriter - modifying att#
0 to POINT (6969 696969)
151208 [FINE] org.geotools.data.jdbc.JDBCTextFeatureWriter - UPDATE coord
SET pts = 'POINT (6969 696969)' WHERE id = '112123'
UPDATE coord SET pts = 'POINT (6969 696969)' WHERE id = '112123'
151248 [SEVERE] org.geotools.data.jdbc.JDBCTextFeatureWriter - SQL
Exception writing geometry column
151268 [FINE] org.vfny.geoserver.servlets.AbstractService - mime type is:
text/xml; charset=UTF-8
151298 [FINE] org.geotools.data.jdbc.ConnectionPool$ConnectionListManager -
Connection closed - adding to available connections.
151358 [INFO] org.vfny.geoserver.servlets.AbstractService - Service handled

The update command generated wouldn't be like:
UPDATE coord SET pts = GeomFromText('POINT (6969 696969)') WHERE id =
'112123' ?

Cheers,

Nuno Faria

-----Original Message-----
From: Chris Holmes [mailto:cholmes@anonymised.com]
Sent: terça-feira, 10 de Maio de 2005 10:59
To: Nuno Faria
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] WFS Transaction Update Geom.

I suspect it may be because the MySQL geometry support is not implemented
on their InnoDB tables, which have full transaction acid support. Instead
they are on the older mysql tables, which don't support updates nearly as
well. I'm not 100% sure this is the reason, I'm mostly parroting what
others have said in the past. But there are issues with updating
geometries in mysql.

But I do feel like I have done updates against geometries, but I may be
wrong, it may have been only inserts? If you turn on 'Verbose Exceptions'
in Config -> Server it should give us a better error report.

Chris

On Fri, 6 May 2005, Nuno Faria wrote:

Hi ppl,

Can anyone help me on this? I’ve a MySQL database with a table ‘coord’

with

3 fields (id [integer][key], pts [geom], treta [varchar]). I create a
DataStore and a FeatureType in geoserver to handle with that table.

Now when I go to demo page to get some xml requests, I cannot UPDATE

values

to my geom field, why?

This requests work:

<!-- INSERT -->

<wfs:Transaction service="WFS" version="1.0.0"

  xmlns:wfs="http://www.opengis.net/wfs&quot;

  xmlns:topp="http://www.openplans.org/topp&quot;

  xmlns:gml="http://www.opengis.net/gml&quot;

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

  xsi:schemaLocation="http://www.openplans.org/topp

http://localhost:8888/geoserver/wfs/DescribeFeatureType?typeName=topp:coord&quot;

>

  <wfs:Insert>

    <topp:coord>

      <topp:pts>

        <gml:Point

srsName="http://www.opengis.net/gml/srs/epsg.xml#27354&quot;&gt;

              <gml:coordinates decimal="." cs="," ts="
">10,180000</gml:coordinates>

        </gml:Point>

      </topp:pts>

      <topp:treta>Local 1</topp:treta>

    </topp:coord>

  </wfs:Insert>

</wfs:Transaction>

<!-- UPDATE -->

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

  xmlns:gml="http://www.opengis.net/gml&quot;&gt;

  <wfs:Update typeName="topp:coord">

    <wfs:Property>

      <wfs:Name>treta</wfs:Name>

      <wfs:Value>Local 2</wfs:Value>

    </wfs:Property>

    <ogc:Filter>

      <ogc:FeatureId fid="coord.10000004"/>

    </ogc:Filter>

  </wfs:Update>

</wfs:Transaction>

But this one don’t work:

<!-- UPDATE -->

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

  xmlns:gml="http://www.opengis.net/gml&quot;&gt;

  <wfs:Update typeName="topp:coord">

    <wfs:Property>

      <wfs:Name>pts</wfs:Name>

      <wfs:Value>

        <gml:Point

srsName="http://www.opengis.net/gml/srs/epsg.xml#27354&quot;&gt;

            <gml:coordinates>-1234,189000</gml:coordinates>

        </gml:Point>

      </wfs:Value>

    </wfs:Property>

    <ogc:Filter>

      <ogc:FeatureId fid="coord.10000004"/>

    </ogc:Filter>

  </wfs:Update>

</wfs:Transaction>

Here is the result:

<wfs:WFS_TransactionResponse version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/wfs

http://localhost:8888/geoserver/data/capabilities/wfs/1.0.0/WFS-transaction.

xsd">

<wfs:TransactionResult>

<wfs:Status>

<wfs:FAILED/>

</wfs:Status>

<wfs:Message>Feature writer already closed</wfs:Message>

</wfs:TransactionResult>

</wfs:WFS_TransactionResponse>

Why?

Best regards,

Nuno André de Sampaio Faria
Laboratório SIG (1.05)
Dep. Informática, Universidade do Minho
4710-057 Gualtar, Braga
Portugal

Tel: +351 253 604457

Web: <http://www.nasf.cjb.net/&gt; http://www.nasf.cjb.net/

--