PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ gserialized_gist_union()

Datum gserialized_gist_union ( PG_FUNCTION_ARGS  )

Definition at line 1410 of file gserialized_gist_nd.c.

1411 {
1412  GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
1413  int *sizep = (int *) PG_GETARG_POINTER(1); /* Size of the return value */
1414  int numranges, i;
1415  GIDX *box_cur, *box_union;
1416 
1417  POSTGIS_DEBUG(4, "[GIST] 'union' function called");
1418 
1419  numranges = entryvec->n;
1420 
1421  box_cur = (GIDX*) DatumGetPointer(entryvec->vector[0].key);
1422 
1423  box_union = gidx_copy(box_cur);
1424 
1425  for ( i = 1; i < numranges; i++ )
1426  {
1427  box_cur = (GIDX*) DatumGetPointer(entryvec->vector[i].key);
1428  gidx_merge(&box_union, box_cur);
1429  }
1430 
1431  *sizep = VARSIZE(box_union);
1432 
1433  POSTGIS_DEBUGF(4, "[GIST] union called, numranges(%i), pageunion %s", numranges, gidx_to_string(box_union));
1434 
1435  PG_RETURN_POINTER(box_union);
1436 
1437 }
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: