PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ gidx_contains()

bool gidx_contains ( GIDX *  a,
GIDX *  b 
)

Definition at line 431 of file gserialized_gist_nd.c.

432{
433 uint32_t i, dims_a, dims_b;
434
435 if (!a || !b)
436 return false;
437
438 if (gidx_is_unknown(a) || gidx_is_unknown(b))
439 return false;
440
441 dims_a = GIDX_NDIMS(a);
442 dims_b = GIDX_NDIMS(b);
443
444 /* For all shared dimensions min(a) > min(b) and max(a) < max(b)
445 Unshared dimensions do not matter */
446 for (i = 0; i < Min(dims_a, dims_b); i++)
447 {
448 /* If the missing dimension was not padded with -+FLT_MAX */
449 if (GIDX_GET_MAX(a, i) != FLT_MAX && GIDX_GET_MAX(b, i) != FLT_MAX)
450 {
451 if (GIDX_GET_MIN(a, i) > GIDX_GET_MIN(b, i))
452 return false;
453 if (GIDX_GET_MAX(a, i) < GIDX_GET_MAX(b, i))
454 return false;
455 }
456 }
457
458 return true;
459}
bool gidx_is_unknown(const GIDX *a)

References gidx_is_unknown().

Referenced by gidx_brin_inclusion_add_value(), gidx_brin_inclusion_merge(), gserialized_contains(), gserialized_gidx_geom_contains(), gserialized_gidx_geom_within(), gserialized_gidx_gidx_contains(), gserialized_gidx_gidx_within(), gserialized_gist_consistent_internal(), gserialized_gist_consistent_leaf(), gserialized_spgist_leaf_consistent_nd(), and gserialized_within().

Here is the call graph for this function:
Here is the caller graph for this function: