pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem on Geometric functions
2+ messages / 2 participants
[nested] [flat]

* Problem on Geometric functions
@ 2005-01-20 09:39 Silke Trissl <trissl@informatik.hu-berlin.de>
  2005-01-20 10:04 ` Re: Problem on Geometric functions Michael Fuhr <mike@fuhr.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Silke Trissl @ 2005-01-20 09:39 UTC (permalink / raw)
  To: pgsql-sql

Hello,

I have a table that has an attribute 'identifier', declared as integer 
and an attribute 'plane_coord' defined as 'point':

Table "reference.coord_test"
    Column    |  Type   | Modifiers
-------------+---------+-----------
  node_name   | integer |
  plane_coord | point   |


I would like to find all points from the table that are within a square. 
Is this possible to do so? I have just found a check-operator to find 
out if a specified point is contained in or on a figure:

	point '(1,1)' @ box '((0,0),(2,2))'
(on http://www.postgresql.org/docs/7.4/interactive/functions-geometry.html).

I am looking for something like

SELECT point(x,y)
FROM reference.coord_test
WHERE point(x,y) € box '((0,0), (2,2))';

Has anyone experience with that?

Regards,

Silke

By the way, I am using PostGreSQL 7.4.1




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Problem on Geometric functions
  2005-01-20 09:39 Problem on Geometric functions Silke Trissl <trissl@informatik.hu-berlin.de>
@ 2005-01-20 10:04 ` Michael Fuhr <mike@fuhr.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Fuhr @ 2005-01-20 10:04 UTC (permalink / raw)
  To: Silke Trissl <trissl@informatik.hu-berlin.de>; +Cc: pgsql-sql

On Thu, Jan 20, 2005 at 10:39:47AM +0100, Silke Trissl wrote:

> Table "reference.coord_test"
>    Column    |  Type   | Modifiers
> -------------+---------+-----------
>  node_name   | integer |
>  plane_coord | point   |
> 
> 
> I would like to find all points from the table that are within a square. 

Try this:

SELECT plane_coord
FROM reference.coord_test
WHERE plane_coord @ box'((0,0), (2,2))';

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-01-20 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-20 09:39 Problem on Geometric functions Silke Trissl <trissl@informatik.hu-berlin.de>
2005-01-20 10:04 ` Michael Fuhr <mike@fuhr.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox