mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
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.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/rtree/rtstrat.c,v 1.26 2005/06/24 00:18:52 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/rtree/rtstrat.c,v 1.27 2005/06/24 20:53:30 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -37,7 +37,11 @@ static const StrategyNumber RTOperMap[RTNStrategies] = {
|
||||
RTOverLeftStrategyNumber, /* right */
|
||||
RTContainsStrategyNumber, /* same */
|
||||
RTContainsStrategyNumber, /* contains */
|
||||
RTOverlapStrategyNumber /* contained-by */
|
||||
RTOverlapStrategyNumber, /* contained-by */
|
||||
RTAboveStrategyNumber, /* overbelow */
|
||||
RTOverAboveStrategyNumber, /* below */
|
||||
RTOverBelowStrategyNumber, /* above */
|
||||
RTBelowStrategyNumber /* overabove */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -52,7 +56,11 @@ static const bool RTNegateMap[RTNStrategies] = {
|
||||
true, /* right */
|
||||
false, /* same */
|
||||
false, /* contains */
|
||||
false /* contained-by */
|
||||
false, /* contained-by */
|
||||
true, /* overbelow */
|
||||
true, /* below */
|
||||
true, /* above */
|
||||
true /* overabove */
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user