On Fri, May 4, 2012 at 10:25 AM, Iris Rittinger Terraplan <
[email protected]> wrote:
> Hallo,
>
> I am trying to edit an WFS-T layer based on a view of a postgis table with
> OpenLayers or MapInfo, but I get the error message, that the table is
> read-only.
>
> I use GeoServer 213 and create a sql View of a layer in Geoserver: select
> flg_id, fl_id, geom_art_id, geom_poly from gruen.flaeche_geom. I select the
> column flg_id as primary key and set the srid and the geometry type of the
> geometry column. When I asked geoserver to choose the geometry type and
> srid geoserver suggests Polygon as geometry type and does not choose any
> srid, even though I set the geometry type and srid in the geometry_columns
> table in postgis as MULTIPOLYGON and 31466.
>
Sql views can never be editable, as GeoServer has no notion of what the
actual table(s) behind the views are.
A view can be anything, simple select, complex join, aggregation, call to a
stored procedure, GeoServer just
executes it "as is" without any interpretation, the only requirements is
that it returns a resultset with a stable
structure (attribute and types).
If you create a view on the database instead, with "CREATE VIEW xxx as
SELECT yyy" then GeoServer
has a chance, but still requires the view to have a primary key.
As far as I know only Oracle allows the association of a primary key to a
view, which makes them editable,
but in all other databases they are read only
Cheers
Andrea
--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users