Re: Problem using ?# with polygon

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Problem using ?# with polygon
Дата
Msg-id 12286.1027086152@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Problem using ?# with polygon  (Pierre-Yves LANDURE <pylandur@ifremer.fr>)
Список pgsql-general
Pierre-Yves LANDURE <pylandur@ifremer.fr> writes:
> i'm trying to intersect a box and a polygon with ?#.. but the polygon
> seems to be automaticaly converted to a box.... so that the given result
> is false

Not surprising considering the lack of any ?# for polygons.

regression=# \do ?#
                           List of operators
 Name | Left arg type | Right arg type | Result type |   Description
------+---------------+----------------+-------------+------------------
 ?#   | "path"        | "path"         | boolean     | paths intersect?
 ?#   | box           | box            | boolean     | overlaps
 ?#   | line          | box            | boolean     |
 ?#   | line          | line           | boolean     | lines intersect?
 ?#   | lseg          | box            | boolean     | intersects?
 ?#   | lseg          | line           | boolean     |
 ?#   | lseg          | lseg           | boolean     | intersect?
(7 rows)

Perhaps you could coerce both to paths and look at whether the distance
(<-> operator) is zero.  Not sure whether that gives quite the result
you want though.

Other alternatives: (a) write and contribute an intersection function
for point and polygon; (b) take a look at PostGIS which probably does
what you want already.

            regards, tom lane

В списке pgsql-general по дате отправления:

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: Looking for types: phone number, email addresses
Следующее
От: Tom Lane
Дата:
Сообщение: Re: COMMIT in PostgreSQL