<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks for information. Is <FONT
face="Times New Roman" size=3>everything ok</FONT> now.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But, </FONT>if I've already created a spatial
table with SRID = -1 </DIV>
<DIV>how can I convert this table (and all its elements) for
SRID=4326? </DIV>
<DIV><FONT face=Arial size=2>Is it possible??</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>Thanks</DIV>
<DIV>Rosāngela </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">rosangela.silva wrote:<BR>><I> Hello
all,<BR></I>><I> <BR></I>><I> I'm having two problems with PostGIS that
I don't know<BR></I>><I> how to solve them. I don't have much experience
with database<BR></I>><I> management. Could you help me,
please?<BR></I>><I> <BR></I>><I> I DROP a table continent, but I don't
DROP the spatial<BR></I>><I> index before, and when I try to execute the
sql again<BR></I>><I> I receive the message below:<BR></I>><I>
<BR></I>><I> $ psql -d geobusca -f continent.sql<BR></I>><I>
ERROR: Relation 'continent' already exists<BR></I>><I>
psql:continent.sql:1: ERROR: Relation 'continent' already
exists<BR></I>><I> ERROR: Cannot insert a duplicate key into unique
index geometry_columns_pk<BR></I>><I> WARNING: Error occurred while
executing PL/pgSQL function addgeometrycolumn</I>><I> WARNING: line
39 at execute statement<BR></I>><I> psql:continent.sql:2: WARNING:
line 39 at execute statementng PL/pgSQL function<BR></I>><I>
psql:continent.sql:2: ERROR: Cannot insert a duplicate key into unique
index ge<BR></I>><I> ometry_columns_pk<BR></I><BR>You need to delete from
geometry_columns where f_table_name = 'continent'.<BR>This is done
automatically if you use dropGeometryColumn() befor dropping<BR>the table.
<BR><BR>><I> <BR></I>><I> In other case, I delete a record from a
spatial table and when I try to<BR></I>><I> insert the same record again
(with some changes) I received the message<BR></I>><I>
below:<BR></I>><I> <BR></I>><I> gisdb=# INSERT INTO wpt (wpt_waypointID,
wpt_Name, the_geom) VALUES (9, 'TUN<BR></I>><I> L25',
GeometryFromText('POINT(-46.63758 -23.97345)', 4326));<BR></I>><I>
ERROR: ExecInsert: rejected due to CHECK constraint "$1" on
"wpt"<BR></I>><I> ERROR: ExecInsert: rejected due to CHECK constraint
"$1" on "wpt"<BR></I>><I> gisdb=#<BR></I><BR>The CHECK constraint "$1"
tries to force geometry SRID as specified in<BR>the geometry_columns. You have
removed the information related to<BR>the specified table, thus the check is
rejected.<BR><BR>><I> <BR></I>><I> I'm using LATLONG/WGS84 and the wpt
table
is:<BR></I>><I>
Table "public.wpt"<BR></I>><I>
Column |
Type | Modifiers<BR></I>><I>
--------------------+---------------------+-----------<BR></I>><I>
wpt_waypointid |
bigint
|<BR></I>><I> wpt_name |
character varying |<BR></I>><I>
the_geom |
geometry
|<BR></I>><I> Check constraints: "$1" (srid(the_geom) =
-1)<BR></I>><I>
"$2" ((geometrytype(the_geom) = 'POINT'::text) OR (the_geom IS
NULL))<BR></I>><I> <BR></I>><I> But I used the sintaxe bellow to create
the table:<BR></I>><I> CREATE TABLE wpt (wpt_waypointID bigint, wpt_Name
varchar);<BR></I>><I> SELECT AddGeometryColumn('geobusca','wpt','the_geom',
4326,'POINT',2);<BR></I>><I> <BR></I>><I> What can I have to
do?<BR></I><BR>The creation sql seems good, but you have to use
DropGeometryColumn()<BR>on the table before dropping the table
itself.<BR><BR>If the problems also occurs immediatly after table creation
(you never<BR>tried to drop anything) try omitting the first parameter from
<BR>AddGeometryColumn.<BR><BR>--strk;<BR><BR></DIV>
<DIV style="FONT: 10pt arial"> </DIV>
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=rosangela.silva@zenitpolar.com.br
href="mailto:rosangela.silva@zenitpolar.com.br">Rosangela Silva</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=postgis-users@postgis.refractions.net
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, May 22, 2003 12:02
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Error messages in PostGIS</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Hello all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm having two problems with PostGIS that I don't
know<BR>how to solve them. I don't have much experience with
database<BR>management. Could you help me, please?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I DROP a table continent, but I don't DROP the
spatial<BR>index before, and when I try to execute the sql again<BR>I receive
the message below:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>$ psql -d geobusca -f
continent.sql<BR>ERROR: Relation 'continent' already
exists<BR>psql:continent.sql:1: ERROR: Relation 'continent' already
exists<BR>ERROR: Cannot insert a duplicate key into unique index
geometry_columns_pk<BR>WARNING: Error occurred while executing PL/pgSQL
function addgeometrycolumn<BR>WARNING: line 39 at execute
statement<BR>psql:continent.sql:2: WARNING: line 39 at execute
statementng PL/pgSQL function<BR>psql:continent.sql:2: ERROR: Cannot
insert a duplicate key into unique index ge<BR>ometry_columns_pk</FONT></DIV>
<DIV> </DIV><FONT face=Arial size=2>
<DIV><BR>In other case, I delete a record from a spatial table and when I try
to<BR>insert the same record again (with some changes) I received the
message<BR>below:</DIV>
<DIV> </DIV>
<DIV>gisdb=# INSERT INTO wpt (wpt_waypointID, wpt_Name, the_geom) VALUES (9,
'TUN<BR>L25', GeometryFromText('POINT(-46.63758 -23.97345)',
4326));<BR>ERROR: ExecInsert: rejected due to CHECK constraint "$1" on
"wpt"<BR>ERROR: ExecInsert: rejected due to CHECK constraint "$1" on
"wpt"<BR>gisdb=#</DIV>
<DIV> </DIV>
<DIV>I'm using LATLONG/WGS84 and the wpt table is:</DIV>
<DIV>
Table "public.wpt"<BR> Column
|
Type |
Modifiers<BR>--------------------+---------------------+-----------<BR> wpt_waypointid
| bigint
|<BR> wpt_name | character
varying |<BR> the_geom |
geometry |<BR>Check
constraints: "$1" (srid(the_geom) =
-1)<BR>
"$2" ((geometrytype(the_geom) = 'POINT'::text) OR (the_geom IS
NULL))<BR></DIV>
<DIV>But I used the sintaxe bellow to create the table:</DIV>
<DIV>CREATE TABLE wpt (wpt_waypointID bigint, wpt_Name varchar);<BR>SELECT
AddGeometryColumn('geobusca','wpt','the_geom', 4326,'POINT',2);</DIV>
<DIV><BR>What can I have to do?<BR>Thanks</DIV>
<DIV> </DIV>
<DIV>Rosāngela.</FONT></DIV></BLOCKQUOTE></BODY></HTML>