I'm using a PostGIS View as a layer to join multiple lookup tables.
I published this view through Geoserver to edit using WFS-T.
My first question is that this is right strategy using a VIEW as a layer for Geoserver's WFS-T or not?
Is there any way to serve normal table as a layer using some alternatives to lookup tables?
Second question, if I have to use view as a Geoserver's layer in this case, is it possible to edit this view using WFS-T?
Answer
While it's possible and common to publish views in GeoServer WFS, the access is limited to read-only usage, you won't be able to edit them.
GeoServer normally marks views as read only because it cannot find a primary key in them (pk is mandatory to generate the gml:id and to support featureid filters). To make the view editable, assuming you can find a truly unique column combination in it, you can setup the primary key metadata table: http://docs.geoserver.org/latest/en/user/data/database/primarykey.html
I've never tried to do so in PostGIS, so no guarantees, but in theory once you have that pk metadata table working, and you have add the insert and update triggers on the view, the view should become editable.
No comments:
Post a Comment