[postgis-users] can't add geometry columns

Nicolas Ribot nicky666 at gmail.com
Sat Aug 20 10:37:21 PDT 2005


Hi Jeff.

You're definitely right: PostGIS is THE good choice to handle geographic data !

You do not have to create metadata table by yourself, but instead, you
must Postgis-enable your database by running the postgis script:
lwpostgis.sql.
You first have to create the plpgsql language, then run the
lwpostgis.sql script.

Typically, to enable one of your database for postgis, run these
commands, as stated in this doc:
http://postgis.refractions.net/README.postgis.txt

createlang plpgsql yourdatabase
psql -f lwpostgis.sql -d yourdatabase

your database is then ready to use spatial information

Nicolas


On 8/20/05, Jeff D. Hamann <jeff.hamann at forestinformatics.com> wrote:
> I'm a newbie to PostGIS and couldn't find this on any FAQs....
> 
> I'm trying out PostGIS and was glad to see the installation for PostgreSQL
> went very smoothly under Windows. I've been using PostgreSQL for a few
> months now and love it. I have a project I want to store geometry for and
> thought PostGIS was the perfect extension, especially since I can create
> shapefiles from the PostGIS database. I downloaded the latest version of
> PostGIS and it seemed to install alright. I then ran the following code to
> add the two required tables:
> 
> CREATE TABLE SPATIAL_REF_SYS (
>   SRID INTEGER NOT NULL PRIMARY KEY,
>   AUTH_NAME VARCHAR(256),
>   AUTH_SRID INTEGER,
>   SRTEXT VARCHAR(2048),
>   PROJ4TEXT VARCHAR(2048)
> );
> 
> -- add a projection... and then some data...
> -- just add them all...
> \i c:/newproj/scripts/spatial_ref_sys.sql
> 
> -- now ad the geometry columns
> CREATE TABLE GEOMETRY_COLUMNS (
>   F_TABLE_CATALOG VARCHAR(256) NOT NULL,
>   F_TABLE_SCHEMA VARCHAR(256) NOT NULL,
>   F_TABLE_NAME VARCHAR(256) NOT NULL,
>   F_GEOMETRY_COLUMN VARCHAR(256) NOT NULL,
>   COORD_DIMENSION INTEGER NOT NULL,
>   SRID INTEGER NOT NULL,
>   TYPE VARCHAR(30) NOT NULL
> );
> 
> And then added, as a test, the roads table from the help file:
> 
> CREATE TABLE roads ( ROAD_ID int4, ROAD_NAME varchar(128) );
> SELECT AddGeometryColumn( 'roads', 'roads_geom', -1, 'GEOMETRY', 3 );
> 
> ERROR:  function addgeometrycolumn("unknown", "unknown", "unknown", integer,
> "unknown", integer) does not exist
> HINT:  No function matches the given name and argument types. You may need
> to add explicit type casts.
> 
> I tried a few combinations of the command to no avail. I'm running postresql
> 8.0.0 and PostGIS 1.0.3
> 
> select version();
>                                          version
> ------------------------------------------------------------------------------------------
>  PostgreSQL 8.0.0 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2
> (mingw-special)
> (1 row)
> 
> 
> select postgis_full_version();
> ERROR:  function postgis_full_version() does not exist
> HINT:  No function matches the given name and argument types. You may need
> to add explicit type casts.
> 
> Does this mean it didn't install?
> 
> I'm sure this is a minor thing in either the docs or the code, but I'm not
> sure how to get past this...
> 
> Thanks for the help,
> Jeff.
> 
> ---
> Jeff D. Hamann
> Forest Informatics, Inc.
> PO Box 1421
> Corvallis, Oregon USA 97339-1421
> 541-754-1428
> jeff.hamann at forestinformatics.com
> www.forestinformatics.com
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list