Skip to content
Permalink
Browse files

Add intersection of tboxes and stboxes

  • Loading branch information
Esteban Zimanyi
Esteban Zimanyi committed Feb 10, 2020
1 parent e3d988c commit d8eb1dd6e66ee92bc755d34a9cec050134911b03
@@ -152,6 +152,20 @@ CREATE CAST (stbox AS period) WITH FUNCTION period(stbox);
CREATE CAST (stbox AS box2d) WITH FUNCTION box2d(stbox);
CREATE CAST (stbox AS box3d) WITH FUNCTION box3d(stbox);

/*****************************************************************************
* Operators
*****************************************************************************/

CREATE FUNCTION stbox_intersection(stbox, stbox)
RETURNS stbox
AS 'MODULE_PATHNAME', 'stbox_intersection'
LANGUAGE C IMMUTABLE STRICT PARALLEL SAFE;

CREATE OPERATOR * (
PROCEDURE = stbox_intersection,
LEFTARG = stbox, RIGHTARG = stbox,
COMMUTATOR = *
);

/*****************************************************************************
* Comparison
@@ -24,7 +24,7 @@
#define MAXSTBOXLEN 256

/*****************************************************************************
* Miscellaneus functions
* Miscellaneous functions
*****************************************************************************/

STBOX *
@@ -565,6 +565,56 @@ stbox_to_box3d(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(result);
}

/*****************************************************************************
* Operators
*****************************************************************************/

/* Intersection of two boxex*/

PG_FUNCTION_INFO_V1(stbox_intersection);

PGDLLEXPORT Datum
stbox_intersection(PG_FUNCTION_ARGS)
{
STBOX *box1 = PG_GETARG_STBOX_P(0);
STBOX *box2 = PG_GETARG_STBOX_P(1);
if (MOBDB_FLAGS_GET_GEODETIC(box1->flags) != MOBDB_FLAGS_GET_GEODETIC(box2->flags))
elog(ERROR, "Cannot intersection geodetic and non geodetic boxes");

bool hasx = MOBDB_FLAGS_GET_X(box1->flags) && MOBDB_FLAGS_GET_X(box2->flags);
bool hasz = MOBDB_FLAGS_GET_Z(box1->flags) && MOBDB_FLAGS_GET_Z(box2->flags);
bool hast = MOBDB_FLAGS_GET_T(box1->flags) && MOBDB_FLAGS_GET_T(box2->flags);
bool geodetic = MOBDB_FLAGS_GET_GEODETIC(box1->flags);
/* If there is no common dimension */
if ((! hasx && ! hast) ||
/* If they do no intersect in one common dimension */
(hasx && (box1->xmin > box2->xmax || box2->xmin > box1->xmax ||
box1->ymin > box2->ymax || box2->ymin > box1->ymax)) ||
(hasz && (box1->zmin > box2->zmax || box2->zmin > box1->zmax)) ||
(hast && (box1->tmin > box2->tmax || box2->tmin > box1->tmax)))
PG_RETURN_NULL();

STBOX *result = stbox_new(hasx, hasz, hast, geodetic);
if (hasx)
{
result->xmin = Max(box1->xmin, box2->xmin);
result->xmax = Min(box1->xmax, box2->xmax);
result->ymin = Max(box1->ymin, box2->ymin);
result->ymax = Min(box1->ymax, box2->ymax);
if (hasz)
{
result->zmin = Max(box1->zmin, box2->zmin);
result->zmax = Min(box1->zmax, box2->zmax);
}
}
if (hast)
{
result->tmin = Max(box1->tmin, box2->tmin);
result->tmax = Min(box1->tmax, box2->tmax);
}
PG_RETURN_POINTER(result);
}

/*****************************************************************************
* Comparison functions
*****************************************************************************/
@@ -489,6 +489,237 @@ SELECT stbox 'STBOX T((, , 2000-01-01), (, , 2000-01-02))'::box3d;

(1 row)

SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';
?column?
----------

(1 row)

SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
?column?
--------------------------
STBOX Z((1,2,3),(4,5,6))
(1 row)

SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
?column?
--------------------------
STBOX Z((1,2,3),(4,5,6))
(1 row)

SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';
?column?
----------

(1 row)

SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
?column?
--------------------------------------------------------------------
STBOX T((1,2,2001-01-01 00:00:00+00),(3,4,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
?column?
--------------------------------------------------------------------
STBOX T((1,2,2001-01-01 00:00:00+00),(3,4,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';
?column?
----------------------------------------------------------------
STBOX T((,,2001-01-01 00:00:00+00),(,,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
?column?
--------------------
STBOX((1,2),(3,4))
(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
?column?
--------------------------
STBOX Z((1,2,3),(4,5,6))
(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
?column?
--------------------------------------------------------------------
STBOX T((1,2,2001-01-01 00:00:00+00),(3,4,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
?column?
-------------------------------------------------------------------------
STBOX ZT((1,2,3,2001-01-01 00:00:00+00),(4,5,6,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';
?column?
----------------------------------------------------------------
STBOX T((,,2001-01-01 00:00:00+00),(,,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
?column?
----------

(1 row)

SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
?column?
----------

(1 row)

SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
?column?
----------------------------------------------------------------
STBOX T((,,2001-01-01 00:00:00+00),(,,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
?column?
----------------------------------------------------------------
STBOX T((,,2001-01-01 00:00:00+00),(,,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';
?column?
----------------------------------------------------------------
STBOX T((,,2001-01-01 00:00:00+00),(,,2001-01-02 00:00:00+00))
(1 row)

SELECT stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))' * stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))';
?column?
----------------------------
GEODSTBOX((1,2,3),(1,2,3))
(1 row)

SELECT stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))' * stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))';
?column?
----------------------------
GEODSTBOX((1,2,3),(1,2,3))
(1 row)

SELECT stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))' * stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))';
?column?
----------

(1 row)

SELECT stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))' * stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))';
?column?
----------------------------
GEODSTBOX((1,2,3),(1,2,3))
(1 row)

SELECT stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))' * stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))';
?column?
----------------------------------------------------------------------------
GEODSTBOX T((1,2,3,2001-01-03 00:00:00+00),(1,2,3,2001-01-04 00:00:00+00))
(1 row)

SELECT stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))' * stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))';
?column?
----------

(1 row)

SELECT stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))' * stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))';
?column?
----------

(1 row)

SELECT stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))' * stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))';
?column?
----------

(1 row)

SELECT stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))' * stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))';
?column?
--------------------------------------------------------------------
GEODSTBOX T((,,2001-01-03 00:00:00+00),(,,2001-01-03 00:00:00+00))
(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((11.0, 2.0, 3.0, 2001-01-01), (14.0, 5.0, 6.0, 2001-01-02))';
?column?
----------

(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 12.0, 3.0, 2001-01-01), (4.0, 15.0, 6.0, 2001-01-02))';
?column?
----------

(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 13.0, 2001-01-01), (4.0, 5.0, 16.0, 2001-01-02))';
?column?
----------

(1 row)

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-02-01), (4.0, 5.0, 6.0, 2001-02-02))';
?column?
----------

(1 row)

/* Errors */
SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))';
ERROR: Cannot intersection geodetic and non geodetic boxes
SELECT stbox_cmp(stbox 'STBOX ZT((1,2,3,2001-01-04), (1,2,3,2001-01-04))', stbox 'STBOX ZT((2,2,3,2001-01-04), (2,2,3,2001-01-04))');
stbox_cmp
-----------
@@ -114,6 +114,59 @@ SELECT stbox 'STBOX T((1.0, 2.0, 2000-01-01), (3.0, 4.0, 2000-01-02))'::box3d;
SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2000-01-01), (4.0, 5.0, 6.0, 2000-01-02))'::box3d;
SELECT stbox 'STBOX T((, , 2000-01-01), (, , 2000-01-02))'::box3d;

-------------------------------------------------------------------------------
-- Operators
-------------------------------------------------------------------------------

SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';

SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
SELECT stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';

SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
SELECT stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';

SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX((1.0, 2.0), (3.0, 4.0))';
SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX Z((1.0, 2.0, 3.0), (4.0, 5.0, 6.0))';
SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX T((1.0, 2.0, 2001-01-01), (3.0, 4.0, 2001-01-02))';
SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))';
SELECT stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))' * stbox 'STBOX T(( , , 2001-01-01), ( , , 2001-01-02))';

SELECT stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))' * stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))';
SELECT stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))' * stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))';
SELECT stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))' * stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))';

SELECT stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))' * stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))';
SELECT stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))' * stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))';
SELECT stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))' * stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))';

SELECT stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))' * stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))';
SELECT stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))' * stbox 'GEODSTBOX T((1.0, 2.0, 3.0, 2001-01-04), (1.0, 2.0, 3.0, 2001-01-03))';
SELECT stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))' * stbox 'GEODSTBOX T(( , , 2001-01-03), ( , , 2001-01-03))';

SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((11.0, 2.0, 3.0, 2001-01-01), (14.0, 5.0, 6.0, 2001-01-02))';
SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 12.0, 3.0, 2001-01-01), (4.0, 15.0, 6.0, 2001-01-02))';
SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 13.0, 2001-01-01), (4.0, 5.0, 16.0, 2001-01-02))';
SELECT stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-01-01), (4.0, 5.0, 6.0, 2001-01-02))' * stbox 'STBOX ZT((1.0, 2.0, 3.0, 2001-02-01), (4.0, 5.0, 6.0, 2001-02-02))';
/* Errors */
SELECT stbox 'STBOX((1.0, 2.0), (3.0, 4.0))' * stbox 'GEODSTBOX((1.0, 2.0, 3.0), (1.0, 2.0, 3.0))';

-------------------------------------------------------------------------------
-- Comparison functions
-------------------------------------------------------------------------------

0 comments on commit d8eb1dd

Please sign in to comment.
You can’t perform that action at this time.