Re: Proper entry of polygon type data

From: Peter Willis <peterw(at)borstad(dot)com>
To: Brent Wood <b(dot)wood(at)niwa(dot)co(dot)nz>, pgsql-general(at)postgresql(dot)org
Subject: Re: Proper entry of polygon type data
Date: 2009-03-25 15:50:28
Message-ID: 49CA52C4.3020706@borstad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Hi Brent,

I am aware of PostGIS and already use it. My question was regarding
the entry format of PostgreSQL polygon data. There is a void
in the PostgreSQL documentation regarding this.

Incidentally, PostGIS uses PostgreSQL polygon, point, and path
data types.

Using PostGIS for simple , non-geographic, polygon rules is a
bit like using a tank to kill a mosquito.

Peter

Brent Wood wrote:
> Hi Peter,
>
> If you want to use Postgres to store/manage/query spatial data, I strongly recommend you look at PostGIS, & not the native Postgres geometry types.
>
>
> Brent Wood
>
> Brent Wood
> DBA/GIS consultant
> NIWA, Wellington
> New Zealand
>>>> Peter Willis <peterw(at)borstad(dot)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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Merlin Moncure 2009-03-25 16:06:43 Re: Proper entry of polygon type data
Previous Message Grzegorz Jaśkiewicz 2009-03-25 15:40:51 Re: MAX(ROW(...)) - feature request

Browse pgsql-hackers by date

  From Date Subject
Next Message Sam Mason 2009-03-25 15:58:06 Re: improving concurrent transactin commit rate
Previous Message Guillaume Smet 2009-03-25 15:48:14 Re: New trigger option of pg_standby