]> granicus.if.org Git - postgis/commitdiff
ADD xmin(box3d) etc... for box3d's.
authorDavid Blasby <dblasby@gmail.com>
Fri, 15 Mar 2002 17:10:49 +0000 (17:10 +0000)
committerDavid Blasby <dblasby@gmail.com>
Fri, 15 Mar 2002 17:10:49 +0000 (17:10 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@129 b70326c6-7e19-0410-871a-916f4a2858ee

postgis.h
postgis.sql.in
postgis_ops.c

index b85aceced5f69234ae796da681ebeff925bdf469..6244242a839d207f309cc079cc84106d7e584b6a 100644 (file)
--- a/postgis.h
+++ b/postgis.h
@@ -477,6 +477,14 @@ Datum factor_chip(PG_FUNCTION_ARGS);
 
 Datum segmentize(PG_FUNCTION_ARGS);
 
+Datum box3d_xmin(PG_FUNCTION_ARGS);
+Datum box3d_ymin(PG_FUNCTION_ARGS);
+Datum box3d_zmin(PG_FUNCTION_ARGS);
+
+Datum box3d_xmax(PG_FUNCTION_ARGS);
+Datum box3d_ymax(PG_FUNCTION_ARGS);
+Datum box3d_zmax(PG_FUNCTION_ARGS);
+
 
 
 Datum transform_geom(PG_FUNCTION_ARGS);
index c310570b2ccc3da1c12d3b94bd9fdb2cdd984610..87b9503c9489d067d3d46f05dbe4008e23b4e1b6 100644 (file)
@@ -632,6 +632,39 @@ CREATE FUNCTION centroid(GEOMETRY)
    AS '@MODULE_FILENAME@'
    LANGUAGE 'c' with (isstrict);
 
+
+------- bbox ops
+
+CREATE FUNCTION xmin(BOX3D)
+   RETURNS FLOAT8
+   AS '@MODULE_FILENAME@','box3d_xmin'
+   LANGUAGE 'c' with (isstrict,iscachable);
+
+CREATE FUNCTION ymin(BOX3D)
+   RETURNS FLOAT8
+   AS '@MODULE_FILENAME@','box3d_ymin'
+   LANGUAGE 'c' with (isstrict,iscachable);
+
+CREATE FUNCTION zmin(BOX3D)
+   RETURNS FLOAT8
+   AS '@MODULE_FILENAME@','box3d_zmin'
+   LANGUAGE 'c' with (isstrict,iscachable);
+
+CREATE FUNCTION xmax(BOX3D)
+   RETURNS FLOAT8
+   AS '@MODULE_FILENAME@','box3d_xmax'
+   LANGUAGE 'c' with (isstrict,iscachable);
+
+CREATE FUNCTION ymax(BOX3D)
+   RETURNS FLOAT8
+   AS '@MODULE_FILENAME@','box3d_ymax'
+   LANGUAGE 'c' with (isstrict,iscachable);
+
+CREATE FUNCTION zmax(BOX3D)
+   RETURNS FLOAT8
+   AS '@MODULE_FILENAME@','box3d_zmax'
+   LANGUAGE 'c' with (isstrict,iscachable);
+
 ------- Aggregate
 
 CREATE FUNCTION combine_bbox(BOX3D,GEOMETRY)
@@ -698,6 +731,8 @@ CREATE FUNCTION force_collection(GEOMETRY) RETURNS GEOMETRY
         AS '@MODULE_FILENAME@'  LANGUAGE 'c' with (isstrict);
 
 
+
+
 -------- GiST support functions
 create function ggeometry_consistent(opaque,GEOMETRY,int4) returns bool 
 as '@MODULE_FILENAME@'   language 'C';
index 5823b5cb35e5b52a642547a7291a3763068f9035..46d1d0f8e5b5254d4b2a81dac47b4bd0a9f1a3a1 100644 (file)
@@ -1294,3 +1294,47 @@ GISTENTRY *rtree_decompress(PG_FUNCTION_ARGS)
     return((GISTENTRY*)PG_GETARG_POINTER(0));
 }
 
+
+PG_FUNCTION_INFO_V1(box3d_xmin);
+Datum box3d_xmin(PG_FUNCTION_ARGS)
+{
+       BOX3D              *box1 = (BOX3D *) PG_GETARG_POINTER(0);
+
+       PG_RETURN_FLOAT8(box1->LLB.x);
+}
+
+PG_FUNCTION_INFO_V1(box3d_ymin);
+Datum box3d_ymin(PG_FUNCTION_ARGS)
+{
+       BOX3D              *box1 = (BOX3D *) PG_GETARG_POINTER(0);
+
+       PG_RETURN_FLOAT8(box1->LLB.y);
+}
+PG_FUNCTION_INFO_V1(box3d_zmin);
+Datum box3d_zmin(PG_FUNCTION_ARGS)
+{
+       BOX3D              *box1 = (BOX3D *) PG_GETARG_POINTER(0);
+
+       PG_RETURN_FLOAT8(box1->LLB.z);
+}
+PG_FUNCTION_INFO_V1(box3d_xmax);
+Datum box3d_xmax(PG_FUNCTION_ARGS)
+{
+       BOX3D              *box1 = (BOX3D *) PG_GETARG_POINTER(0);
+
+       PG_RETURN_FLOAT8(box1->URT.x);
+}
+PG_FUNCTION_INFO_V1(box3d_ymax);
+Datum box3d_ymax(PG_FUNCTION_ARGS)
+{
+       BOX3D              *box1 = (BOX3D *) PG_GETARG_POINTER(0);
+
+       PG_RETURN_FLOAT8(box1->URT.y);
+}
+PG_FUNCTION_INFO_V1(box3d_zmax);
+Datum box3d_zmax(PG_FUNCTION_ARGS)
+{
+       BOX3D              *box1 = (BOX3D *) PG_GETARG_POINTER(0);
+
+       PG_RETURN_FLOAT8(box1->URT.z);
+}