318 int ndims_a, ndims_b;
320 POSTGIS_DEBUG(5,
"entered function");
322 if ( a == NULL && b == NULL )
324 elog(ERROR,
"gidx_union_edge received two null arguments");
342 ndims_a = GIDX_NDIMS(a);
343 ndims_b = GIDX_NDIMS(b);
346 result = Max(GIDX_GET_MAX(a,0),GIDX_GET_MAX(b,0)) - Min(GIDX_GET_MIN(a,0),GIDX_GET_MIN(b,0));
349 for ( i = 1; i < ndims_b; i++ )
351 result += (Max(GIDX_GET_MAX(a,i),GIDX_GET_MAX(b,i)) - Min(GIDX_GET_MIN(a,i),GIDX_GET_MIN(b,i)));
355 for ( i = ndims_b; i < ndims_a; i++ )
357 result += (GIDX_GET_MAX(a,i) - GIDX_GET_MIN(a,i));
360 POSTGIS_DEBUGF(5,
"edge( %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)