Re: Proper entry of polygon type data

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: peterw(at)borstad(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Proper entry of polygon type data
Date: 2009-03-25 16:06:43
Message-ID: b42b73150903250906q11714e2dyc3b3a8ea406786ef@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 23, 2009 at 2:13 PM, Peter Willis <peterw(at)borstad(dot)com> wrote:
> 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?

the documentation
(http://www.postgresql.org/docs/8.3/interactive/datatype-geometric.html#AEN5582)
shows that you are inserting a sequence of vertexes. Also, it is
stated that the polygon is closed, which implies that you don't need
to close it yourself.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike Charnoky 2009-03-25 16:09:39 Re: intermittant performance problem
Previous Message Peter Willis 2009-03-25 15:50:28 Re: Proper entry of polygon type data