[Cartoweb-users] Insert geometry postgis
Oliver Christen
oliver.christen at camptocamp.com
Fri May 30 06:44:46 EDT 2008
Hi
you can try to change the line 299 in file ServerEdit:
$sql = sprintf('INSERT INTO %s.%s (%s %s) ' .
to
$sql = sprintf('INSERT INTO "%s.%s" (%s %s) ' .
or use only lowercase in your table names
----- Original Message -----
From: Giovanni Virdis
To: cartoweb-users at lists.maptools.org
Sent: Friday, May 30, 2008 10:33 AM
Subject: [Cartoweb-users] Insert geometry postgis
Hi
I have implements the solution to edit the geometry with postgis but I have the problem.
This is the layer configuration in map file
LAYER
NAME FABRIZIO
STATUS ON
TYPE POLYGON
CONNECTIONTYPE POSTGIS
CONNECTION 'dbname=Iwork_topo user=Iwork_topo password=colapasta host=10.0.0.3'
DATA '"G" from (select "G", "A" from "AAA1") as foo using unique "A" using srid=-1'
TEMPLATE 'ttt'
TRANSPARENCY 50
LABELITEM "A"
CLASS
NAME "class"
STYLE
COLOR 50 50 255
OUTLINECOLOR 255 50 50
END
LABEL
TYPE TRUETYPE
FONT "Vera"
SIZE 7
COLOR 0 0 0
POSITION cc
BACKGROUNDCOLOR 245 235 235
BACKGROUNDSHADOWCOLOR 55 55 55
BACKGROUNDSHADOWSIZE 1 1
END
END
LABELMAXSCALE 50000
METADATA
'id_attribute_string' 'A' # query
'query_returned_attributes' 'A'
'edit_table' 'AAA1' # PostGIS table
'edit_geometry_column' 'G' # PostGIS geometry column
'edit_geometry_type' 'polygon' # PostGIS geometry type
'edit_srid' '-1'
'edit_attributes' 'A|integer' # list of the editable fields
'edit_filter' '' # mapserver filter
END
END
When I draw the polygon and insert the value for the filed A the system generate this error:
Class : SoapFaultWrapper
Message : Unable to insert feature in edit database Message: DB Error: unknown error Userinfo: INSERT INTO public.AAA1 (G , A) VALUES (GeometryFromText('MULTIPOLYGON(((1522314.4719729544 4518388,1518017.9437111818 4498500,1525706.467969091 4496918,1531812.0607621362 4505958,1531585.9276957272 4516354,1522314.4719729544 4518388)))', -1) , '11') [nativecode=ERROR: la relazione "public.aaa1" non esiste]Backtrace:I have the problem with the " .
The insert for postegre must be in this format INSERT INTO "public.AAA1" ("G ", "A")
How I can do?
------------------------------------------------------------------------------
_______________________________________________
Cartoweb-users mailing list
Cartoweb-users at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/cartoweb-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/cartoweb-users/attachments/20080530/05f205cd/attachment-0001.html
More information about the Cartoweb-users
mailing list