aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/geo_ops.c
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2010-01-14 16:31:09 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2010-01-14 16:31:09 +0000
commit4cbe473938779ec414d90c2063c4398e68a70838 (patch)
tree25d2e76a103381f0d76d1b3ed47dc9efb601170d /src/backend/utils/adt/geo_ops.c
parente99767bc28d8ef9ea627cd63336b2b74087c0128 (diff)
downloadpostgresql-4cbe473938779ec414d90c2063c4398e68a70838.tar.gz
postgresql-4cbe473938779ec414d90c2063c4398e68a70838.zip
Add point_ops opclass for GiST.
Diffstat (limited to 'src/backend/utils/adt/geo_ops.c')
-rw-r--r--src/backend/utils/adt/geo_ops.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/backend/utils/adt/geo_ops.c b/src/backend/utils/adt/geo_ops.c
index 2eb72428819..35f1a13ab67 100644
--- a/src/backend/utils/adt/geo_ops.c
+++ b/src/backend/utils/adt/geo_ops.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/geo_ops.c,v 1.106 2010/01/02 16:57:54 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/geo_ops.c,v 1.107 2010/01/14 16:31:09 teodor Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3202,6 +3202,16 @@ on_pb(PG_FUNCTION_ARGS)
pt->y <= box->high.y && pt->y >= box->low.y);
}
+Datum
+box_contain_pt(PG_FUNCTION_ARGS)
+{
+ BOX *box = PG_GETARG_BOX_P(0);
+ Point *pt = PG_GETARG_POINT_P(1);
+
+ PG_RETURN_BOOL(pt->x <= box->high.x && pt->x >= box->low.x &&
+ pt->y <= box->high.y && pt->y >= box->low.y);
+}
+
/* on_ppath -
* Whether a point lies within (on) a polyline.
* If open, we have to (groan) check each segment.