PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ gserialized_gist_union()

Datum gserialized_gist_union ( PG_FUNCTION_ARGS  )

Definition at line 1219 of file gserialized_gist_nd.c.

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