Re: Proper entry of polygon type data

Поиск
Список
Период
Сортировка
От Brent Wood
Тема Re: Proper entry of polygon type data
Дата
Msg-id 49CA21EE0200007B0001A028@gwia1.ham.niwa.co.nz
обсуждение исходный текст
Ответ на Proper entry of polygon type data  (Peter Willis <peterw@borstad.com>)
Ответы Re: Proper entry of polygon type data  (Peter Willis <peterw@borstad.com>)
Список pgsql-general
Hi Peter,

If you want to use Postgres to store/manage/query spatial data, I strongly recommend you look at PostGIS, & not the
nativePostgres geometry types. 


Brent Wood

Brent Wood
DBA/GIS consultant
NIWA, Wellington
New Zealand
>>> Peter Willis <peterw@borstad.com> 03/24/09 10:35 AM >>>
Hello,

I would like to use 'polygon' type data and am wondering about
the entry format of the vertex coordinates.

Are the coordinates of the polygon type to be entered one
entry per polygon vertex, or one entry per polygon edge segment?

For example:
I have a triangle with vertex corners A, B, C.

One entry per vertex format suggests

INSERT INTO my_table (my_polygon_column)
VALUES ( ((Ax,Ay),(Bx,By),(Cx,Cy)) );


One entry per edge format suggests

INSERT INTO my_table (my_polygon_column)
VALUES ( ((Ax,Ay),(Bx,By),(Bx,By),(Cx,Cy),(Cx,Cy),(Ax,Ay)) );

Which entry format is the correct one?

If per vertex format is the correct one, do I need to
'close' the path by entering the first vertex again at the end of the
list?

ie:
INSERT INTO my_table (my_polygon_column)
VALUES ( ((Ax,Ay),(Bx,By),(Cx,Cy),(Ax,Ay)) );

Thanks,

Peter

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

NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: Res: Case sensitivity problems with user name
Следующее
От: Erik Jones
Дата:
Сообщение: Re: Last modification time of a database?