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

◆ getOctant()

static uint16_t getOctant ( const GIDX *  centroid,
const GIDX *  inBox 
)
static

Definition at line 125 of file gserialized_spgist_nd.c.

126{
127 uint16_t octant = 0, dim = 0x01;
128 int ndims, i;
129
130 ndims = Min(GIDX_NDIMS(centroid), GIDX_NDIMS(inBox));
131
132 for (i = 0; i < ndims; i++)
133 {
134 /* If the missing dimension was not padded with -+FLT_MAX */
135 if (GIDX_GET_MAX(centroid, i) != FLT_MAX && GIDX_GET_MAX(inBox, i) != FLT_MAX)
136 {
137 if (GIDX_GET_MAX(inBox, i) > GIDX_GET_MAX(centroid, i))
138 octant |= dim;
139 dim = dim << 1;
140 if (GIDX_GET_MIN(inBox, i) > GIDX_GET_MIN(centroid, i))
141 octant |= dim;
142 dim = dim << 1;
143 }
144 }
145
146 return octant;
147}
Datum centroid(PG_FUNCTION_ARGS)

References centroid().

Referenced by gserialized_spgist_choose_nd(), and gserialized_spgist_picksplit_nd().

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