Bug report #16043

WFS-T Broken in QGIS 2.18.* with Geoserver Endpoints

Added by Giovanni Manghi over 7 years ago. Updated over 7 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Alessandro Pasotti
Category:Web Services clients/WFS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:23958

Description

Works as expected on LTR.

Tested with several datasources, PostGIS included.

Associated revisions

Revision 502a8da4
Added by Alessandro Pasotti over 7 years ago

[bugfix] WFS-T Fixes #15597 #16043

Tested on GeoServer and QGIS Server

Needs forward port to master

Revision 93770b1c
Added by Alessandro Pasotti over 7 years ago

Merge pull request #3989 from elpaso/wfst-200-fix-15597

[bugfix] WFS-T fixes #15597 #16043 geoserver compatibility

Revision 9324bdac
Added by Alessandro Pasotti over 7 years ago

[bugfix] WFS-T Fixes #15597 #16043

This commit fixes a few bugs on WFS-T with
servers that support WFS-T > 1.0.0 when user
configure version != 1.0.0 ("auto" is the default).

It also fixes WFS-T multiple operations on GeoServer
when an insert operation is among them and the feature
store does not return generated feature ids for the
inserted features (i.e. shapefiles).

Tested on GeoServer and QGIS Server

(cherry-picked from 502a8da40380)

Revision 39a5f6a4
Added by Alessandro Pasotti over 7 years ago

Merge pull request #3999 from elpaso/wfst-fixes-15597-16043

[bugfix] WFS-T Fixes #15597 #16043

History

#1 Updated by Giovanni Manghi over 7 years ago

Works as expected using QGIS Server.

To replicate just fire a Geoserver instance (tested 2.8 and 2.9 here), import a layer, enable wfs-t.

#2 Updated by Alessandro Pasotti over 7 years ago

  • Assignee set to Alessandro Pasotti
  • Affected QGIS version changed from 2.18.2 to master

Confirmed:
2.14 WFS-T works fine with QGIS Server and GeoServer
2.18 WFS-T works fine with QGIS Server and fails with GeoServer
master WFS-T works fine with QGIS Server and fails with GeoServer

#3 Updated by Giovanni Manghi over 7 years ago

it work if forcing version to 1.0.

#4 Updated by Alessandro Pasotti over 7 years ago

Basically: WFS-T is only implemented for 1.0.0, unfortunately the user does not know that because the developer did not implement any way to warn the user.

What happens is that GeoServer supports 1.0.0, 1.1.0 and 2.0.0, the default "auto" value will fetch the highests.

qgswfscapabilities.cpp line 478 (2.18):

// TODO: remove me when WFS-T 1.1 or 2.0 is done
if ( !mCaps.version.startsWith( "1.0" ) )
return;

Quick fix: change the default value in the WFS dialog from "auto" to 1.0.0 until the implementation is complete.

#5 Updated by Alessandro Pasotti over 7 years ago

There might be another issue in 2.18 and master:
Step to reproduce in GeoServer:
- enable WFS transactional in GeoServer
- add a WFS-T GeoServer shapefile layer to QGIS, set version=1.0.0
- enable editing
- add a new feature
- save
- end editing
- enable editing
- add a new feature
- save
- end editing
- zoom in/out to refresh the canvas

Expected result: 2 new features appear in the map
Actual result: only 1 new feature appears in the map (the first added feature).
Note: the second feature was actually inserted in GeoServer, the problem is that QGIS does not notice it

#6 Updated by Alessandro Pasotti over 7 years ago

The reason for the observed behavior is that GeoServer always return new0 as the feature id if the feature store does not support id generation as happen in shapefiles.

#7 Updated by Even Rouault over 7 years ago

The reason for the observed behavior is that GeoServer always return new0 as the feature id if the feature store does not support id generation as happen in shapefiles.

Ouch, sounds like an issue of the server. The returned id is supposed to be unique...

#8 Updated by Alessandro Pasotti over 7 years ago

It's unique within a single transaction.

#9 Updated by Anonymous over 7 years ago

  • Status changed from Open to Closed

#10 Updated by Giovanni Manghi over 7 years ago

  • Status changed from Closed to Reopened

#11 Updated by Giovanni Manghi over 7 years ago

  • Resolution set to fixed/implemented
  • Status changed from Reopened to Closed

Also available in: Atom PDF