PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ gserialized_gist_union()

Datum gserialized_gist_union ( PG_FUNCTION_ARGS  )

Definition at line 1409 of file gserialized_gist_nd.c.

References gidx_copy(), gidx_merge(), gserialized_gist_same(), and PG_FUNCTION_INFO_V1().

Referenced by gserialized_gist_penalty().

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