2

My organisation uses a SAAS and part of that service publishes data via a WFS using Geoserver 2.7.0. I have sent a GetFeature request via a browser (IE11) and it returns the GML however, if I refresh the link the FID changes:

:wfs_BBQ gml:id="wfs_BBQ.fid-74424e53_159f7837ba8_350">

:wfs_BBQ gml:id="wfs_BBQ.fid-74424e53_159f7837ba8_ec3">

I am using QGIS 2.18.3 (running on Win 10) and I'm told QGIS needs persistent FIDs (see: Duplicate WFS Featues in QGIS 2.18.3) and that Geoserver should create a persistent FID if the WFS has a Primary Key. The data does have a Unique ID (integer) so I'm hoping this meets the requirement.

How do I ensure the FIDs are persistent?

4

To generate a permanent FID GeoTools (which underlies GeoServer) uses whatever the underlying datastore provides. So if you are querying a database should be the primary key. So if your FIDs change the problem is likely that you haven't set a primary key up for your table, or GeoTools can't work out what it is. This may occur if you are using a view, to fix this you can create a metadata table to help out.

You would also see this effect if you were foolish enough to try to run a WFS on top of a Shapefile, here the solution is not to do that.

  • It took a while to get this change implemented but now that I have static FIDs I get the correct number of records. BTW If anyone else has this issue then using a distinct query as a work-around seemed to work while waiting for the fix to be implemented. – Colin Feb 17 '17 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.