265 int ndims_a, ndims_b;
267 POSTGIS_DEBUG(5,
"entered function");
269 if ( a == NULL && b == NULL )
271 elog(ERROR,
"gidx_union_volume received two null arguments");
289 ndims_a = GIDX_NDIMS(a);
290 ndims_b = GIDX_NDIMS(b);
293 result = Max(GIDX_GET_MAX(a,0),GIDX_GET_MAX(b,0)) - Min(GIDX_GET_MIN(a,0),GIDX_GET_MIN(b,0));
296 for ( i = 1; i < ndims_b; i++ )
298 result *= (Max(GIDX_GET_MAX(a,i),GIDX_GET_MAX(b,i)) - Min(GIDX_GET_MIN(a,i),GIDX_GET_MIN(b,i)));
302 for ( i = ndims_b; i < ndims_a; i++ )
304 result *= (GIDX_GET_MAX(a,i) - GIDX_GET_MIN(a,i));
307 POSTGIS_DEBUGF(5,
"volume( %s union %s ) = %.12g", gidx_to_string(a), gidx_to_string(b), result);
static bool gidx_is_unknown(const GIDX *a)
static float gidx_volume(GIDX *a)
static void gidx_dimensionality_check(GIDX **a, GIDX **b)