Re: Create GEOM Column

Поиск
Список
Период
Сортировка
От Mark Wimer
Тема Re: Create GEOM Column
Дата
Msg-id OFC0DA7B13.693CD022-ON852578A1.005A7D41-852578A1.005CEB51@usgs.gov
обсуждение исходный текст
Ответ на Create GEOM Column  (James Smith <james.david.smith@gmail.com>)
Список pgsql-novice
Hi James,

Put in the correct schema name below if it isn't public; and you may need to quote your lat/lon field names if they're really capitalized ( i.e. "Latitude", "Longitude"). This should work...  

SELECT AddGeometryColumn(
       'public',                       --schema
       'CAMDENGPS',                      --tablename
       'the_geom',                     --field to contain geom
       4326,                           --srid from spatial_ref_sys
       'POINT',                        --type of geometry
       2                               --dimensions, 1 didn't work.
 );

Then...

UPDATE public."CAMDENGPS"
SET the_geom = ST_SetSRID(ST_Point(longitude, latitude),4326);



Mark


From:James Smith <james.david.smith@gmail.com>
To:pgsql-novice@postgresql.org
Date:05/29/2011 04:31 PM
Subject:[NOVICE] Create GEOM Column
Sent by:pgsql-novice-owner@postgresql.org





Dear all,

Would appreciate some help. I have created an existing database (with
PostGIS extension) andhas a table called CAMDENGPS which is populated
with approx 600,000 rows. There are 20 or so columns in the table, two
of which are Latitude and Longitude (WGS84). I would now like to
create a Geom column with points in, the values of which should be
taken from the other columns. Could someone provide me with sample
code as to how to do this please?

Thank you

James

--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice


В списке pgsql-novice по дате отправления:

Предыдущее
От: "Jean-Yves F. Barbier"
Дата:
Сообщение: Re: indexes multicolumn
Следующее
От: "Jean-Yves F. Barbier"
Дата:
Сообщение: BYTEA or LO?