From: | Peter Willis <peterw(at)borstad(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Proper entry of polygon type data |
Date: | 2009-03-24 15:10:01 |
Message-ID: | 49C8F7C9.5050603@borstad.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Steve Midgley | 2009-03-25 15:49:20 | Re: Alter Table/Indexing |
Previous Message | Tom Lane | 2009-03-24 14:35:31 | Re: Alter Table/Indexing |