[postgis-users] Fw: please help me about postgis

alireza ghahremanian mat2ag at yahoo.com
Sun Jan 21 03:02:55 PST 2007


The mentioned table is mandatory and another program fill its data in it, so I need another table with geometry column which fill it with data gathered from table test.

----- Original Message ----
From: Shoaib Burq <saburq at gmail.com>
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Cc: alireza ghahremanian <mat2ag at yahoo.com>
Sent: Sunday, January 21, 2007 2:21:09 PM
Subject: Re: [postgis-users] Fw: please help me about postgis

The table you created is not spatial. to make it spatial you need to
add a spatial column to it using AddGeometryColumn() function.

There is no need to specify x and y and explicitly. The
AddGeometryColumn() takes care of it. If you need a table with point
data then do something like:

CREATE TABLE test
{
  id integer NOT NULL,
  name varchar(128),
  CONSTRAINT test_pk PRIMARY KEY (id)
}
WITHOUTOIDS;

SELECT AddGeometryColumn('test', 'test_geom', 4326, 'POINT', 2 );

have a read of this
http://postgis.refractions.net/docs/ch04.html#id2837854 for a detailed
explanation of the process.

hope this helps
Shoaib
-- 
http://geospatial.nomad-labs.com

On 1/21/07, alireza ghahremanian <mat2ag at yahoo.com> wrote:
> I have a table like this:
>
> CREATE TABLE test
> (
>   id integer NOT NULL,
>   x double precision,
>   y double precision,
>   CONSTRAINT test_pk PRIMARY KEY (id)
> )
> WITHOUT OIDS;
>
> which contains some coordinates  (x,y) of a track now I want to insert a geometry entry from this data in another table with a SELECT command something like this
>
> SELECT  GeomFromText('LINESTRING(x y)') FROM test;
>
> but it does not work please help me. I should note that the data in table test will update every 5 sec. so I must my geometry tables with respect to test table data.
>
> with special thanks
>
>
>
>
>
>
>
>
>
>
> ____________________________________________________________________________________
> Food fight? Enjoy some healthy debate
> in the Yahoo! Answers Food & Drink Q&A.
> http://answers.yahoo.com/dir/?link=list&sid=396545367
>
> Dear Sandro Santilli
>
>
>
>
>
> ____________________________________________________________________________________
> Yahoo! Music Unlimited
> Access over 1 million songs.
> http://music.yahoo.com/unlimited
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>





 
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121



More information about the postgis-users mailing list