From b90f8f20f035c3313f8a284346b5a1d155cfd2f0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 24 Jun 2005 20:53:34 +0000 Subject: Extend r-tree operator classes to handle Y-direction tests equivalent to the existing X-direction tests. An rtree class now includes 4 actual 2-D tests, 4 1-D X-direction tests, and 4 1-D Y-direction tests. This involved adding four new Y-direction test operators for each of box and polygon; I followed the PostGIS project's lead as to the names of these operators. NON BACKWARDS COMPATIBLE CHANGE: the poly_overleft (&<) and poly_overright (&>) operators now have semantics comparable to box_overleft and box_overright. This is necessary to make r-tree indexes work correctly on polygons. Also, I changed circle_left and circle_right to agree with box_left and box_right --- formerly they allowed the boundaries to touch. This isn't actually essential given the lack of any r-tree opclass for circles, but it seems best to sync all the definitions while we are at it. --- contrib/rtree_gist/rtree_gist.sql.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'contrib/rtree_gist/rtree_gist.sql.in') diff --git a/contrib/rtree_gist/rtree_gist.sql.in b/contrib/rtree_gist/rtree_gist.sql.in index 2fc38a7024e..e59edcacff0 100644 --- a/contrib/rtree_gist/rtree_gist.sql.in +++ b/contrib/rtree_gist/rtree_gist.sql.in @@ -27,7 +27,7 @@ LANGUAGE 'C'; CREATE FUNCTION gbox_penalty(internal,internal,internal) RETURNS internal AS 'MODULE_PATHNAME' -LANGUAGE 'C' with (isstrict); +LANGUAGE 'C' STRICT; CREATE FUNCTION gbox_picksplit(internal, internal) RETURNS internal @@ -56,6 +56,10 @@ AS OPERATOR 6 ~= , OPERATOR 7 ~ , OPERATOR 8 @ , + OPERATOR 9 &<| , + OPERATOR 10 <<| , + OPERATOR 11 |>> , + OPERATOR 12 |&> , FUNCTION 1 gbox_consistent (internal, box, int4), FUNCTION 2 gbox_union (internal, internal), FUNCTION 3 gbox_compress (internal), @@ -95,6 +99,10 @@ AS OPERATOR 6 ~= RECHECK, OPERATOR 7 ~ RECHECK, OPERATOR 8 @ RECHECK, + OPERATOR 9 &<| RECHECK, + OPERATOR 10 <<| RECHECK, + OPERATOR 11 |>> RECHECK, + OPERATOR 12 |&> RECHECK, FUNCTION 1 gpoly_consistent (internal, polygon, int4), FUNCTION 2 gbox_union (internal, internal), FUNCTION 3 gpoly_compress (internal), -- cgit v1.2.3