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

◆ gserialized_gist_union()

Datum gserialized_gist_union ( PG_FUNCTION_ARGS  )

Definition at line 1222 of file gserialized_gist_nd.c.

1223{
1224 GistEntryVector *entryvec = (GistEntryVector *)PG_GETARG_POINTER(0);
1225 int *sizep = (int *)PG_GETARG_POINTER(1); /* Size of the return value */
1226 int numranges, i;
1227 GIDX *box_cur, *box_union;
1228
1229 POSTGIS_DEBUG(4, "[GIST] 'union' function called");
1230
1231 numranges = entryvec->n;
1232
1233 box_cur = (GIDX *)PG_DETOAST_DATUM(entryvec->vector[0].key);
1234
1235 box_union = gidx_copy(box_cur);
1236
1237 for (i = 1; i < numranges; i++)
1238 {
1239 box_cur = (GIDX *)PG_DETOAST_DATUM(entryvec->vector[i].key);
1240 gidx_merge(&box_union, box_cur);
1241 }
1242
1243 *sizep = VARSIZE(box_union);
1244
1245 POSTGIS_DEBUGF(4, "[GIST] union called, numranges(%i), pageunion %s", numranges, gidx_to_string(box_union));
1246
1247 PG_RETURN_POINTER(box_union);
1248}
GIDX * gidx_copy(GIDX *b)
void gidx_merge(GIDX **b_union, GIDX *b_new)

References gidx_copy(), and gidx_merge().

Here is the call graph for this function: