Re: [GENERAL] Geometric operators

Поиск
Список
Период
Сортировка
От Jeff Hoffmann
Тема Re: [GENERAL] Geometric operators
Дата
Msg-id 376A6DC8.6EEE68E5@remapcorp.com
обсуждение исходный текст
Ответ на Geometric operators  (Steffen Zimmert <szimmert@crcg.edu>)
Ответы Re: [GENERAL] Geometric operators
Список pgsql-general
Steffen Zimmert wrote:
>
> Hello everybody,
>
> I am wondering if the geometric datatypes of the PostgreSQL system allow
> the following queries.
> The database should contain the box datatype which is used as the index.
> The system should allow queries like "Retrieve all boxes that are
> contained in the query box". Is that possible with the standard types of
> the system?

It should be working (at least it worked fine in 6.4.2).  The operator
you are looking for is "&&" which is a box overlap. For example, if you
create a table with a box field (we'll call it "box_field"), you could
create an index on it (if you have a lot of records):

create index mytable_index on my_table using rtree (box_field box_ops);

and then a select would be

select * from mytable where box_field && '(100,100),(200,200)'::box;

where the '(100,100),(200,200)'::box would be the bounding query box.
If you read my question from earlier today, you'll notice i'm having
problems with it in 6.5.  I don't know if that's just me or something
that's changed since 6.4.2.

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

Предыдущее
От: Steffen Zimmert
Дата:
Сообщение: Geometric operators
Следующее
От: Jeff Hoffmann
Дата:
Сообщение: Re: [GENERAL] Geometric operators