266 int ndims_a, ndims_b;
268 POSTGIS_DEBUG(5,
"entered function");
270 if ( a == NULL && b == NULL )
272 elog(ERROR,
"gidx_union_volume received two null arguments");
290 ndims_a = GIDX_NDIMS(a);
291 ndims_b = GIDX_NDIMS(b);
294 result = Max(GIDX_GET_MAX(a,0),GIDX_GET_MAX(b,0)) - Min(GIDX_GET_MIN(a,0),GIDX_GET_MIN(b,0));
297 for ( i = 1; i < ndims_b; i++ )
299 result *= (Max(GIDX_GET_MAX(a,i),GIDX_GET_MAX(b,i)) - Min(GIDX_GET_MIN(a,i),GIDX_GET_MIN(b,i)));
303 for ( i = ndims_b; i < ndims_a; i++ )
305 result *= (GIDX_GET_MAX(a,i) - GIDX_GET_MIN(a,i));
308 POSTGIS_DEBUGF(5,
"volume( %s union %s ) = %.12g", gidx_to_string(a), gidx_to_string(b), result);
bool gidx_is_unknown(const GIDX *a)
static float gidx_volume(GIDX *a)
static void gidx_dimensionality_check(GIDX **a, GIDX **b)