3

After creating a table in Postgis, making it available in Geoserver and then creating the necessary stores and layers, I loaded the resulting WFS file in QGIS.

When trying to populate the features with an edit, I get faced with the following error:

Could not commit changes to layer teststore:test

Errors: ERROR: 1 feature(s) not added. Provider errors: WFS service exception: {http://geoserver.org/teststore}test is read-only

I have admin privileges in Geoserver and Postgres, and I haven't found anything resembling a read only restriction.

How to get around this problem?

4
  • You should read up on WFS-T.
    – HeikkiVesanto
    Commented Jun 1, 2016 at 14:43
  • @Vesanto care to elaborate?
    – Luffydude
    Commented Jun 1, 2016 at 16:32
  • It's hard to tell from your question what you have tried in GeoServer, and I no expert on the matter. But WFS does not support editing. For editing you will need WFS-T, which is transactional WFS.
    – HeikkiVesanto
    Commented Jun 1, 2016 at 16:34
  • @Vesanto Like I've said, I simply tried adding the Geoserver layer as a WFS but when I tried editing, it did not work saying it was read only. I don't see any option to make it a WFS-T and my internet search didn't produce any result
    – Luffydude
    Commented Jun 1, 2016 at 16:41

2 Answers 2

1

The typical reason for this errors is that the underlying table does not have a primary key, it's a view in the database, or the layer is configured as "sql view" in GeoSever

1
  • It had a primary key, the problem was SQL view but now I'm not sure how I did it but it got fixed and now I'm able to fix my edits
    – Luffydude
    Commented Jun 7, 2016 at 8:20
-1

Problem was solved by enabling jsonp in the geoserver

1
  • How are these thing related? Why would you need to enable jsonp to do a WFS insert?
    – ca0v
    Commented Feb 24, 2017 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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