Re: [GENERAL] Proper entry of polygon type data

2009-03-25 Thread Peter Willis

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 pet...@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


Re: [GENERAL] Proper entry of polygon type data

2009-03-25 Thread Peter Willis

Mark Cave-Ayland wrote:


Peter Willis wrote:

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


Errr... no it doesn't. PostGIS uses its own internal types to represent 
all the different geometries, although it does provide a cast between 
the existing PostgreSQL types as an aid for people wishing to migrate.


I stand corrected I guess.
The last time I looked at the actual guts of PostGIS was
WY back. And that was long before I actually started
using it.

...of course, my WAAA back memory may be crossed with my WAAAY
back forgetfulness, there as well

Peter

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


[GENERAL] Proper entry of polygon type data

2009-03-23 Thread Peter Willis

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


Re: [GENERAL] Question about accessing current row data inside trigger

2005-03-20 Thread peter Willis
Hello,
This issue is resolved.
I was using the wrong struct.
Peter
Tom Lane wrote:
peter Willis [EMAIL PROTECTED] writes:
 

I have a trigger function written in C.
...
   Since the trigger is called after each row update the actual row data
should be available in some way to the trigger.
   

Sure: tg_trigtuple or tg_newtuple depending on which state you want.
See
http://www.postgresql.org/docs/8.0/static/trigger-interface.html
regards, tom lane
 


---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faq


Re: [GENERAL] Question about accessing current row data inside trigger

2005-03-20 Thread peter Willis
Hello,
I resolved this issue already.
The trigger now works fine.
I was looking at the wrong structure.
Thanks,
Peter
Michael Fuhr wrote:
On Tue, Mar 08, 2005 at 11:37:14AM -0800, peter Willis wrote:
 

I have a trigger function written in C.
The trigger function is called via:
CREATE TRIGGER after_update AFTER UPDATE ON some_table
  FOR EACH ROW EXECUTE PROCEDURE  my_trigger_function();
  Since the trigger is called after each row update the actual row data
should be available in some way to the trigger.
  What functionality (SPI ?) do I use to use the column values from
the current row in the actual trigger?
   

See Writing Trigger Functions in C and C-Language Functions in
the documentation.  Here are links to documentation for the latest
version of PostgreSQL:
http://www.postgresql.org/docs/8.0/interactive/trigger-interface.html
http://www.postgresql.org/docs/8.0/interactive/xfunc-c.html
 


---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
 subscribe-nomail command to [EMAIL PROTECTED] so that your
 message can get through to the mailing list cleanly


[GENERAL] Question about accessing current row data inside trigger

2005-03-13 Thread peter Willis
Hello,
I have a trigger function written in C.
The trigger function is called via:
CREATE TRIGGER after_update AFTER UPDATE ON some_table
   FOR EACH ROW EXECUTE PROCEDURE  my_trigger_function();
   Since the trigger is called after each row update the actual row data
should be available in some way to the trigger.
   What functionality (SPI ?) do I use to use the column values from
the current row in the actual trigger?
thanks for any insight,
Peter

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


[GENERAL] How do I recover from pg_xlog/0000000000000000 (log file 0, segment 0) failed: No such file or directory

2004-10-19 Thread peter Willis
Hello,
Is there a way to recover from the following error?
I have (had) an existing database and wish not
to lose the data tables.
Thanks for any help,
Pete
[EMAIL PROTECTED] /]$ pg_ctl start
postmaster successfully started
[EMAIL PROTECTED] /]$ LOG:  database system shutdown was interrupted at 
2004-10-18 11:41:55 PDT
LOG:  open of /web2-disk1/grip/database/pg_xlog/ (log 
file 0, segment 0) failed: No such file or directory
LOG:  invalid primary checkpoint record
LOG:  open of /web2-disk1/grip/database/pg_xlog/ (log 
file 0, segment 0) failed: No such file or directory
LOG:  invalid secondary checkpoint record
PANIC:  unable to locate a valid checkpoint record
LOG:  startup process (pid 2803) was terminated by signal 6
LOG:  aborting startup due to startup process failure

[EMAIL PROTECTED] /]$

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send unregister YourEmailAddressHere to [EMAIL PROTECTED])