[postgis] Problem with GeometryFromText function of chapter 3 Postgis

Silvio torodedutoesdraiato at yahoo.it
Fri Jan 4 03:49:01 PST 2002


Hi all,
I have follow example of PostGis manual in the chapter 3 point 2: 

2. How do I insert a GIS object into the database?

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: 

  CREATE TABLE gtest ( ID int4, NAME varchar(20) );
  SELECT AddGeometryColumn('dbname','gtest','geom',-1,'LINESTRING',2);
     

If the table creation fails, you probably have not loaded the PostGIS functions and objects into this database. See the installation instructions.

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: 

  INSERT INTO gtest (ID, NAME,	GEOM) 
    VALUES (1, 'First Geometry', GeometryFromText('LINESTRING(2 3,4 5,6 5,7 8)', -1));

     


but when I do this I will have:

mydb=# INSERT INTO gtest (ID,NAME,GEOM) VALUES (1,'First Geometry',GeometryFrom
Test('LINESTRING(2 3,4 5,6 5,7 8)', -1));
ERROR:  Function 'geometryfromtest(unknown, int4)' does not exist
        Unable to identify a function that satisfies the given argument types
        You may need to add explicit typecasts

What's the problem for this error?
 
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20020104/cc8ccf07/attachment.html>


More information about the postgis-users mailing list