[Cartoweb-users] [Edit] layer configuration in postgresql
Pierre GIRAUD
pierre.giraud at camptocamp.com
Thu Apr 6 11:52:27 EDT 2006
What if you try with "oid" as "id_attribute_string" ?
Pierre GIRAUD
Jacolin Yves wrote:
>Hi,
>I am testing the edit plugin. I got a problem with it :
>if I use the edit_poly postgresql layer (ie EDITPOLY layer in mapfile) all
>work fine ! But I imported a shapefile with shp2pgsql in my database. I can
>create new shapes and edit their attribut, but the selection failed so I can
>not update, delete my shape.
>
>The mapfile contains :
> LAYER
> NAME espece
> STATUS ON
> TYPE POLYGON
> CONNECTIONTYPE POSTGIS
> CONNECTION 'dbname=edit_db user=postgres password=postgres host=localhost'
> DATA 'the_geom from (select the_geom, oid, gid, nom, code, patrimon from
>espece) as foo'
> TEMPLATE 'ttt'
> LABELITEM "nom"
> CLASS
> NAME "class"
> STYLE
> COLOR 50 50 255
> OUTLINECOLOR 255 50 50
> END
> LABEL
> FONT "Vera"
> TYPE TRUETYPE
> SIZE 7
> OUTLINECOLOR 255 255 255
> COLOR 0 0 0
> POSITION cc
> END
> END
> METADATA
> 'id_attribut_string' 'gid' #query
> 'query_returned_attributes' 'gid nom code patrimon'
> 'edit_table' 'espece' # PostGIS table
> 'edit_geometry_column' 'the_geom' # PostGIS geometry column
> 'edit_geometry_type' 'polygon' # PostGIS geometry type
> 'edit_srid' '-1'
> 'edit_attributes' 'gid,nom|string,code|string,patrimon|integer' # list
>of the editable fields
> 'edit_filter' '' # Mapserver filter
> END
> END
>
>That is very similar to the EDITPOLY layer. My layer got this fields :
>gid integer NOT NULL nextval('public.espece_gid_seq'::text)
>id integer
>nom character varying(100)
>code character varying(10)
>patrimon smallint
>the_geom geometry
>
>gid and id seems to have same fonction (idenfication). gid would be created by
>shp2pgsql ?!
>
>The error message that appears after trying to select a shape is :
>class: SoapFaultWrapper
>message: Error [8, Undefined
>index: , /var/www/html/cartoweb3/plugins/edit/server/ServerEdit.php, 429]
>Backtrace:
>
>file: 275 - /var/www/html/cartoweb3/common/Common.php
>call: Common::cartowebErrorHandler()
>
>file: 429 - /var/www/html/cartoweb3/plugins/edit/server/ServerEdit.php
>call: Common::cartowebErrorHandler()
>
>Have you got an idea ?
>
>Y.
>
>
More information about the Cartoweb-users
mailing list