[Geoserver-users] WFS-T Update

Hi,

I can confirm that when I sent your request to Geoserver 2.5 RC1 the message is ”SUCCESS” but the result is not correct and the poly_landmarks shapefile gets corrupted. Both features .56 and .57 are getting the same geometry and attributes. They seem to come from the latter update with LAND having a value “82.0” . It does not seem to matter that your request is perhaps invalid for WFS 1.0.0 because the native SRS of this feature type is EPSG:4326 and WFS 1.0.0 does not officially support reprojecting. I tried also to edit two features from the feature type with Kosmo GIS and the result was also faulty even the message was “SUCCESS”.

-Jukka Rahkonen-

···

Sergey Kolosov wrote:

Let it be tiger:poly_landmarks. Request example:

<wfs:Transaction xmlns:wfs=“http://www.opengis.net/wfs” service=“WFS” version=“1.0.0” xsi:schemaLocation=“http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”>

<wfs:Update typeName=“tiger:poly_landmarks” xmlns:tiger=“http://www.census.gov”>

wfs:Property

wfs:Namethe_geom</wfs:Name>

wfs:Value

<gml:MultiPolygon xmlns:gml=“http://www.opengis.net/gml” srsName=“EPSG:900913”>

gml:polygonMember

gml:Polygon

gml:outerBoundaryIs

gml:LinearRing

<gml:coordinates decimal=“.” cs=“,” ts=" ">-8230125.691579768,4993247.3897700105 -8230169.2175006615,4993127.855385715 -8230102.648445177,4993084.134431487 -8230233.226207859,4992784.2757977685 -8230199.719041135,4992754.835093904 -8230764.776776323,4991705.037707402 -8231496.925067168,4990563.371533031 -8231742.718502805,4990351.301562958 -8232301.097068548,4990483.899942138 -8232271.708722983,4990553.952643983 -8231884.984812018,4991477.930123315 -8231296.549983768,4992721.272799961 -8231590.333317099,4991106.482587857 -8230125.691579768,4993247.3897700105</gml:coordinates>

</gml:LinearRing>

</gml:outerBoundaryIs>

</gml:Polygon>

</gml:polygonMember>

</gml:MultiPolygon>

</wfs:Value>

</wfs:Property>

wfs:Property

wfs:NameLAND</wfs:Name>

wfs:Value81.0</wfs:Value>

</wfs:Property>

wfs:Property

wfs:NameCFCC</wfs:Name>

wfs:ValueH11</wfs:Value>

</wfs:Property>

wfs:Property

wfs:NameLANAME</wfs:Name>

wfs:ValueHudson River</wfs:Value>

</wfs:Property>

<ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc”>

<ogc:FeatureId fid=“poly_landmarks.56”/>

</ogc:Filter>

</wfs:Update>

<wfs:Update typeName=“tiger:poly_landmarks” xmlns:tiger=“http://www.census.gov”>

wfs:Property

wfs:Namethe_geom</wfs:Name>

wfs:Value

<gml:MultiPolygon xmlns:gml=“http://www.opengis.net/gml” srsName=“EPSG:900913”>

gml:polygonMember

gml:Polygon

gml:outerBoundaryIs

gml:LinearRing

<gml:coordinates decimal=“.” cs=“,” ts=" ">-8233756.3767714845,4986487.314203222 -8233543.7565441,4986842.882464728 -8233322.898674395,4987511.833139738 -8233009.422988365,4988461.271628286 -8232924.708855884,4988718.325963565 -8232519.617228944,4989947.48364408 -8232463.957483554,4990094.645672044 -8232301.097068548,4990483.899942138 -8231742.718502805,4990351.301562958 -8231733.812943543,4989911.134965183 -8231635.517833186,4989474.519924509 -8231718.562173307,4989177.715265621 -8231997.751456177,4988287.796887231 -8232026.026606834,4988215.847708972 -8232091.705106393,4988235.8580611 -8232038.939667765,4988188.039273078 -8232052.6319651315,4988115.943697382 -8232139.572487429,4988151.991418621 -8232064.988428608,4988073.275138288 -8232595.314482673,4987080.033250603 -8232657.096800054,4986772.562185991 -8232999.84951216,4986149.411319248 -8233051.61307537,4986065.415509419 -8233055.286618566,4986050.852386521 -8233079.442948066,4985997.45445521 -8233097.142747099,4985976.860289813 -8233270.1332357675,4986104.397713022 -8233121.744354561,4985966.2690216815 -8233163.489163603,4985912.871553269 -8233326.572217592,4986006.868945291 -8233200.558554031,4985889.188472123 -8233253.101353679,4985837.850810354 -8233382.565921454,4985925.52216675 -8233267.350248499,4985809.607856592 -8233307.870543141,4985755.62285474 -8233438.00302786,4985859.180178578 -8233452.14060319,4985830.937163076 -8233335.366457363,4985730.46918205 -8233454.923590459,4985599.700548361 -8233550.324394056,4985680.309127736 -8233576.707113369,4985654.420168338 -8233621.23490968,4985683.839445705 -8234094.565384467,4985920.667859637 -8232999.994396007,4986561.423260524 -8233824.726938822,4986373.011395459 -8233761.49746806,4986478.781901051 -8233756.3767714845,4986487.314203222</gml:coordinates>

</gml:LinearRing>

</gml:outerBoundaryIs>

</gml:Polygon>

</gml:polygonMember>

</gml:MultiPolygon>

</wfs:Value>

</wfs:Property>

wfs:Property

wfs:NameLAND</wfs:Name>

wfs:Value82.0</wfs:Value>

</wfs:Property>

wfs:Property

wfs:NameCFCC</wfs:Name>

wfs:ValueH11</wfs:Value>

</wfs:Property>

wfs:Property

wfs:NameLANAME</wfs:Name>

wfs:ValueHudson River</wfs:Value>

</wfs:Property>

<ogc:Filter xmlns:ogc=“http://www.opengis.net/ogc”>

<ogc:FeatureId fid=“poly_landmarks.57”/>

</ogc:Filter>

</wfs:Update>

</wfs:Transaction>

2014-02-24 15:56 GMT+04:00 Rahkonen Jukka (Tike) <jukka.rahkonen@anonymised.com>:

Hi,

It would be excellent if you could reproduce this with some of the Geoserver demo layers, for example topp:states, and send the WFS-T requests you have captured from OpenLayers and QGIS.

-Jukka Rahkonen-

Sergey Kolosov wrote:

Hi!

I’m working with WFS-T. When i save two modified features per one transaction, i get two features with equal geometries. I’ve checked request in browser console and it’s fine - two different fids and two different geometries are transmitted. But after saving i see one feature exactly upon the another. I discovered this behavior in OpenLayers and then reproduced in QGIS.

Version of GeoServer - 2.4.1.

On Mon, Feb 24, 2014 at 3:19 PM, Rahkonen Jukka (Tike) <
jukka.rahkonen@anonymised.com> wrote:

Hi,

I can confirm that when I sent your request to Geoserver 2.5 RC1 the
message is "SUCCESS" but the result is not correct and the poly_landmarks
shapefile gets corrupted. Both features .56 and .57 are getting the same
geometry and attributes. They seem to come from the latter update with LAND
having a value "82.0" . It does not seem to matter that your request is
perhaps invalid for WFS 1.0.0 because the native SRS of this feature type
is EPSG:4326 and WFS 1.0.0 does not officially support reprojecting. I
tried also to edit two features from the feature type with Kosmo GIS and
the result was also faulty even the message was "SUCCESS".

Thanks for confirming. Can anybody open a bug report at
jira.codehaus.org/browse/GEOS

Cheers
Andrea

--
== Our support, Your Success! Visit http://opensdi.geo-solutions.it for
more information ==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

This bug has been opened in late February for version 2.4.1.

https://jira.codehaus.org/browse/GEOS-6367

I am on version 2.4.8 and am still seeing this issue. If I try to update two or more features, all edited features get the geometry of the first feature in the list.

An example:

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

<wfs:Transaction xmlns:wfs=“http://www.opengis.net/wfs” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” service=“WFS” version=“1.1.0” xsi:schemaLocation=“http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd gov.usgs.cida.ch.ye3dbe10d4be14cdf8a0110bccf34a062 geoserver/ye3dbe10d4be14cdf8a0110bccf34a062/wfs/DescribeFeatureType?version=1.1.0&outputFormat=GML3&typename=ye3dbe10d4be14cdf8a0110bccf34a062:test_test_shorelines_transects”>
<wfs:Update xmlns:feature=“gov.usgs.cida.ch.ye3dbe10d4be14cdf8a0110bccf34a062” typeName=“feature:test_test_shorelines_transects”>
wfs:Property
wfs:Namethe_geom</wfs:Name>
wfs:Value
<gml:MultiCurve xmlns:gml=“http://www.opengis.net/gml” srsName=“EPSG:900913”>
gml:curveMember
gml:LineString
gml:posList-17597914.13042791 2420343.559791646 -17598378.054163497 2423221.2031396953</gml:posList>
</gml:LineString>
</gml:curveMember>
</gml:MultiCurve>
</wfs:Value>
</wfs:Property>


TransectID
3


</wfs:Update>
<wfs:Update xmlns:feature=“gov.usgs.cida.ch.ye3dbe10d4be14cdf8a0110bccf34a062” typeName=“feature:test_test_shorelines_transects”>
wfs:Property
wfs:Namethe_geom</wfs:Name>
wfs:Value
<gml:MultiCurve xmlns:gml=“http://www.opengis.net/gml” srsName=“EPSG:900913”>
gml:curveMember
gml:LineString
gml:posList-17597384.688466575 2420429.895606989 -17597821.79825631 2423141.7380101085</gml:posList>
</gml:LineString>
</gml:curveMember>
</gml:MultiCurve>
</wfs:Value>
</wfs:Property>


TransectID
4


</wfs:Update>
</wfs:Transaction>

The response:
<wfs:TransactionResponse xmlns:wfs=“http://www.opengis.net/wfs” xmlns:gml=“http://www.opengis.net/gml” xmlns:ogc=“http://www.opengis.net/ogc” xmlns:ows=“http://www.opengis.net/ows"xmlns:xlink="http://www.w3.org/1999/xlink” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:ye3dbe10d4be14cdf8a0110bccf34a062="gov.usgs.cida.ch.ye3dbe10d4be14cdf8a0110bccf34a062"version=“1.1.0” xsi:schemaLocation=“http://www.opengis.net/wfs http://localhost:8081/coastal-hazards-geoserver/schemas/wfs/1.1.0/wfs.xsd”>
wfs:TransactionSummary
wfs:totalInserted0</wfs:totalInserted>
wfs:totalUpdated3</wfs:totalUpdated>
wfs:totalDeleted0</wfs:totalDeleted>
</wfs:TransactionSummary>
wfs:TransactionResults/
wfs:InsertResults
wfs:Feature
<ogc:FeatureId fid=“none”/>
</wfs:Feature>
</wfs:InsertResults>
</wfs:TransactionResponse>

Note that I’ve only requested two features to be updated. The response tells me that 3 features were updated and the second feature in my request gets the geometry of the first feature instead

__________________________ (╯°□°)╯︵ ┻━┻
Ivan Suftin - Applications Developer - isuftin@anonymised.com
Office: (608) 821-3825 - Cell : (608) 345-8963
Center for Integrated Data Analytics - http://cida.usgs.gov/
United States Geological Survey
8505 Research Way, Middleton, WI 53562

···

On Mon, Feb 24, 2014 at 3:19 PM, Rahkonen Jukka (Tike) <jukka.rahkonen@anonymised.com> wrote:

Hi,

I can confirm that when I sent your request to Geoserver 2.5 RC1 the message is ”SUCCESS” but the result is not correct and the poly_landmarks shapefile gets corrupted. Both features .56 and .57 are getting the same geometry and attributes. They seem to come from the latter update with LAND having a value “82.0” . It does not seem to matter that your request is perhaps invalid for WFS 1.0.0 because the native SRS of this feature type is EPSG:4326 and WFS 1.0.0 does not officially support reprojecting. I tried also to edit two features from the feature type with Kosmo GIS and the result was also faulty even the message was “SUCCESS”.

Thanks for confirming. Can anybody open a bug report at jira.codehaus.org/browse/GEOS

Cheers
Andrea

== Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information ==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


Delving a little deeper, it seems like the issue occurs in version 2.4.8 at org.geoserver.wfs.UpdateElementHandler.java on line 226:

SimpleFeatureCollection features = store.getFeatures(filter);

This gets the filtered feature plus all the features that were already processed in previous iterations of the execute that runs in a for loop for each feature in org.geoserver.wfs.Transaction.java on line 321

So on the first loop, it modifies the first feature, in the second loop it modifies the first and second feature and that’s why Geoserver responds with 3 features updated instead of two and it looks like it modifies all the features in the last loop to have the geometry of the last feature in the loop.

I’m not sure why getFeatures() with the filter gets more than one feature since the filter specifically has one FID in it.

__________________________ (╯°□°)╯︵ ┻━┻
Ivan Suftin - Applications Developer - isuftin@anonymised.com
Office: (608) 821-3825 - Cell : (608) 345-8963
Center for Integrated Data Analytics - http://cida.usgs.gov/
United States Geological Survey
8505 Research Way, Middleton, WI 53562

···

On Mon, Feb 24, 2014 at 3:19 PM, Rahkonen Jukka (Tike) <jukka.rahkonen@anonymised.com> wrote:

Hi,

I can confirm that when I sent your request to Geoserver 2.5 RC1 the message is ”SUCCESS” but the result is not correct and the poly_landmarks shapefile gets corrupted. Both features .56 and .57 are getting the same geometry and attributes. They seem to come from the latter update with LAND having a value “82.0” . It does not seem to matter that your request is perhaps invalid for WFS 1.0.0 because the native SRS of this feature type is EPSG:4326 and WFS 1.0.0 does not officially support reprojecting. I tried also to edit two features from the feature type with Kosmo GIS and the result was also faulty even the message was “SUCCESS”.

Thanks for confirming. Can anybody open a bug report at jira.codehaus.org/browse/GEOS

Cheers
Andrea

== Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information ==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Sun, Oct 26, 2014 at 1:40 AM, Ivan Suftin <isuftin@anonymised.com> wrote:

Delving a little deeper, it seems like the issue occurs in version 2.4.8
at org.geoserver.wfs.UpdateElementHandler.java on line 226:

SimpleFeatureCollection features = store.getFeatures(filter);

This gets the filtered feature plus all the features that were already
processed in previous iterations of the execute that runs in a for loop for
each feature in org.geoserver.wfs.Transaction.java on line 321

So on the first loop, it modifies the first feature, in the second loop it
modifies the first and second feature and that’s why Geoserver responds
with 3 features updated instead of two and it looks like it modifies all
the features in the last loop to have the geometry of the last feature in
the loop.

I’m not sure why getFeatures() with the filter gets more than one feature
since the filter specifically has one FID in it.

Please add your findings to the ticket.

About it being opened in February, tickets do not have an expiry date
(unlike other OSGeo projects, we don't close automatically tickets that
have been
inactive for a year), here is one that is 8 years old:
http://jira.codehaus.org/browse/GEOS-662

Resolution depends on someone coding a fix, which normally means that
someone needs it for a project she/he is working on,
or decides that is worth spending the weekend on. Some tickets seem to
never qualify for either of the cases.

You seem to have a need and some understanding of how things work, so
you're the perfect candidate to attempt a fix :slight_smile:

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------