Subject: rectangle intersection

From: Walid Aref <[email-masked]>
Date: Fri, 29 Nov 91 06:35:20 -0800

Can I perform the following operation in Postgres using any possible 
mechanism (e.g., using ADTs, etc) or any equivalent syntax?

	attr1 intersects attr2 

where attr1 represents boxes indexed by an R-tree, and attr2 represents 
another set of boxes, also indexed by another R-tree?

Thanks.
walid

---

From: postarch (Postgres Mailing Archive)
Date: Mon, 02 Dec 91 14:28:18 PST

> another set of boxes, also indexed by another R-tree?

Some potentially interesting box operators are as follows:

 operator       function        description
 --------       --------        -----------
 box1 << box2	box_left      - box1 is entirely to the left of box2
 box1 &< box2	box_overleft  - box1 is to the left of or overlaps box2
 box1 &> box2	box_overright - box1 is to the right of or overlaps box2
 box1 >> box2	box_right     - box1 is entirely to the right of box2
 box1 @  box2	box_contained - box1 is contained by box2
 box1 ~  box2	box_contain   - box1 contains box2
 box1 ~= box2	box_same      - box1 is exactly the same as box2
 box1 && box2	box_overlap   - box1 and box2 overlap

These comprise the operator class for boxes in rtree indices. An example
of the overlap operator with rtree indices is given in the video demo.

Jeff Meredith
[email-masked]