<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>


<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV><FONT face=Arial size=2>I have follow example of PostGis manual in the 
chapter 3 point 2: </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<DIV class=QUESTION>
<P><A name=AEN118></A><B>2. </B>How do I insert a GIS object into the 
database?</P></DIV>
<DIV class=ANSWER>
<P><B></B>First, you need to create a table with a column of type "geometry" to 
hold your GIS data. Connect to your database with "psql" and try the following 
SQL: </P>
<TABLE width="100%" bgColor=#e0e0e0 border=0>
  <TBODY>
  <TR>
    <TD><PRE class=PROGRAMLISTING>  CREATE TABLE gtest ( ID int4, NAME varchar(20) );
  SELECT AddGeometryColumn('dbname','gtest','geom',-1,'LINESTRING',2);</PRE></TD></TR></TBODY></TABLE>
<P>If the table creation fails, you probably have not loaded the PostGIS 
functions and objects into this database. See the <A 
href="http://postgis.refractions.net/docs/c55.html#PGINSTALL">installation 
instructions</A>.</P>
<P>Then, you can insert a geometry into the table using a SQL insert statement. 
The GIS object itself is formatted using the OpenGIS Consortium "well-known 
text" format: </P>
<TABLE width="100%" bgColor=#e0e0e0 border=0>
  <TBODY>
  <TR>
    <TD><PRE class=PROGRAMLISTING>  INSERT INTO gtest (ID, NAME,    GEOM) 
    VALUES (1, 'First Geometry', GeometryFromText('LINESTRING(2 3,4 5,6 5,7 8)', -1));
</PRE></TD></TR></TBODY></TABLE></DIV></DIV>
<DIV> </DIV>
<DIV>but when I do this I will have:</DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>mydb=# INSERT INTO gtest (ID,NAME,GEOM) VALUES 
(1,'First Geometry',GeometryFrom<BR>Test('LINESTRING(2 3,4 5,6 5,7 8)', 
-1));<BR>ERROR:  Function 'geometryfromtest(unknown, int4)' does not 
exist<BR>        Unable to identify a 
function that satisfies the given argument 
types<BR>        You may need to add explicit 
typecasts</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>What's the problem for this error?</FONT></DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<br>

<!-- |**|begin egp html banner|**| -->

<table border=0 cellspacing=0 cellpadding=2>
<tr bgcolor=#FFFFCC>
<td align=center><font size="-1" color=#003399><b>Yahoo! Groups Sponsor</b></font></td>
</tr>
<tr bgcolor=#FFFFFF>
<td align=center width=470><table border=0 cellpadding=0 cellspacing=0><tr><td align=center><font face=arial size=-2>ADVERTISEMENT</font><br><a href="http://rd.yahoo.com/M=216105.1806326.3318126.1261774/D=egroupweb/S=1705007183:HM/A=915128/R=0/O=1/I=brandr-lrec/postholidaygroup/*http://shopping.yahoo.com/domain?d=holiday&cf=posthol01" target=_top><img src="http://us.a1.yimg.com/us.yimg.com/a/ya/yahoo_shopping/ps_lrec01.gif" alt="" width="300" height="250" border="0"></a></td></tr></table></td>
</tr>
<tr><td><img alt="" width=1 height=1 src="http://us.adserver.yahoo.com/l?M=216105.1806326.3318126.1261774/D=egroupmail/S=1705007183:HM/A=915128/rand=933433403"></td></tr>
</table>

<!-- |**|end egp html banner|**| -->


<br>
<tt>
To unsubscribe from this group, send an email to:<BR>
postgis-unsubscribe@yahoogroups.com<BR>
<BR>
</tt>
<br>

<br>
<tt>Your use of Yahoo! Groups is subject to the <a href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</a>.</tt>
</br>

</BODY></HTML>