pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedpoint <-> polygon not supported?
5+ messages / 2 participants
[nested] [flat]
* point <-> polygon not supported?
@ 2003-02-19 00:12 Scott Ding <scott.ding@autodesk.com>
2003-02-20 14:55 ` Re: point <-> polygon not supported? Tomasz Myrta <jasiek@klaster.net>
0 siblings, 1 reply; 5+ messages in thread
From: Scott Ding @ 2003-02-19 00:12 UTC (permalink / raw)
To: pgsql-sql
I'm using version 7.3.2. I got the following error when I executed the
sql statement in psql:
llogicdb=> select ID, POINAME, ADDRESS, (GEOM::point <->
polygon('((-122.406903
, 37.785768),(-122.405903, 37.785768),(-122.405903,
37.786768),(-122.406903, 37
.786768))')) * 87878.15460046429 as CFF_DISTANCE from NT_SF_POI where
(FACILITY
TYPE='3578') and (GEOM::point <-> polygon('((-122.406903,
37.785768),(-122.4059
03, 37.785768),(-122.405903, 37.786768),(-122.406903, 37.786768))')) *
87878.15
460046429 <= 3.41381770434236E-5 order by CFF_DISTANCE;
ERROR: Unable to identify an operator '<->' for types 'point' and
'polygon'
You will have to retype this query using an explicit cast
Does this mean that the <-> operator does not support distance between a
point and a simple polygon?
Scott Ding
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: point <-> polygon not supported?
2003-02-19 00:12 point <-> polygon not supported? Scott Ding <scott.ding@autodesk.com>
@ 2003-02-20 14:55 ` Tomasz Myrta <jasiek@klaster.net>
0 siblings, 0 replies; 5+ messages in thread
From: Tomasz Myrta @ 2003-02-20 14:55 UTC (permalink / raw)
To: Scott Ding <scott.ding@autodesk.com>; +Cc: pgsql-sql
Scott Ding wrote:
> I’m using version 7.3.2. I got the following error when I executed the
> sql statement in psql:
<cut>
> Does this mean that the <-> operator does not support distance between a
> point and a simple polygon?
No.
Try this query:
select o.oprname,t1.typname as left, t2.typname as right
from
pg_operator o
join pg_type t1 on (o.oprleft=t1.oid)
join pg_type t2 on (o.oprright=t2.oid)
where oprname='<->';
Regards,
Tomasz Myrta
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: point <-> polygon not supported?
@ 2003-02-20 16:44 Scott Ding <scott.ding@autodesk.com>
2003-02-20 17:05 ` Re: point <-> polygon not supported? Tomasz Myrta <jasiek@klaster.net>
0 siblings, 1 reply; 5+ messages in thread
From: Scott Ding @ 2003-02-20 16:44 UTC (permalink / raw)
To: Tomasz Myrta <jasiek@klaster.net>; +Cc: pgsql-sql
Tomasz,
Thanks for the tip. What I want to do is something like the following:
Select * from table where (table.geom <-> polygon('((3,3), (3,4), (4,5),
(5,4), (5,3))')) < 1.0);
Table.geom is a point column.
How do I modify your statement to accomplish the above?
Regards,
Scott Ding
-----Original Message-----
From: Tomasz Myrta [mailto:jasiek@klaster.net]
Sent: Thursday, February 20, 2003 6:55 AM
To: Scott Ding
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] point <-> polygon not supported?
Scott Ding wrote:
> I'm using version 7.3.2. I got the following error when I executed the
> sql statement in psql:
<cut>
> Does this mean that the <-> operator does not support distance between
a
> point and a simple polygon?
No.
Try this query:
select o.oprname,t1.typname as left, t2.typname as right
from
pg_operator o
join pg_type t1 on (o.oprleft=t1.oid)
join pg_type t2 on (o.oprright=t2.oid)
where oprname='<->';
Regards,
Tomasz Myrta
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: point <-> polygon not supported?
2003-02-20 16:44 Re: point <-> polygon not supported? Scott Ding <scott.ding@autodesk.com>
@ 2003-02-20 17:05 ` Tomasz Myrta <jasiek@klaster.net>
0 siblings, 0 replies; 5+ messages in thread
From: Tomasz Myrta @ 2003-02-20 17:05 UTC (permalink / raw)
To: Scott Ding <scott.ding@autodesk.com>; +Cc: pgsql-sql
Scott Ding wrote:
> Tomasz,
>
> Thanks for the tip. What I want to do is something like the following:
>
> Select * from table where (table.geom <-> polygon('((3,3), (3,4), (4,5),
> (5,4), (5,3))')) < 1.0);
>
> Table.geom is a point column.
I have never user geometric types...
I think, you can use some data type, which can be used for counting
distance, for example circle:
Select * from table where (circle(table.geom,0) <-> polygon('((3,3),
(3,4), (4,5), (5,4), (5,3))')) < 1.0);
Regards,
Tomasz Myrta
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: point <-> polygon not supported?
@ 2003-02-20 18:34 Scott Ding <scott.ding@autodesk.com>
0 siblings, 0 replies; 5+ messages in thread
From: Scott Ding @ 2003-02-20 18:34 UTC (permalink / raw)
To: Tomasz Myrta <jasiek@klaster.net>; +Cc: pgsql-sql
Tomasz,
This works!
Thanks,
Scott Ding
-----Original Message-----
From: Tomasz Myrta [mailto:jasiek@klaster.net]
Sent: Thursday, February 20, 2003 9:06 AM
To: Scott Ding
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] point <-> polygon not supported?
Scott Ding wrote:
> Tomasz,
>
> Thanks for the tip. What I want to do is something like the following:
>
> Select * from table where (table.geom <-> polygon('((3,3), (3,4),
(4,5),
> (5,4), (5,3))')) < 1.0);
>
> Table.geom is a point column.
I have never user geometric types...
I think, you can use some data type, which can be used for counting
distance, for example circle:
Select * from table where (circle(table.geom,0) <-> polygon('((3,3),
(3,4), (4,5), (5,4), (5,3))')) < 1.0);
Regards,
Tomasz Myrta
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2003-02-20 18:34 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-19 00:12 point <-> polygon not supported? Scott Ding <scott.ding@autodesk.com>
2003-02-20 14:55 ` Tomasz Myrta <jasiek@klaster.net>
2003-02-20 16:44 Re: point <-> polygon not supported? Scott Ding <scott.ding@autodesk.com>
2003-02-20 17:05 ` Tomasz Myrta <jasiek@klaster.net>
2003-02-20 18:34 Re: point <-> polygon not supported? Scott Ding <scott.ding@autodesk.com>
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