PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ gserialized_gist_union_2d()

Datum gserialized_gist_union_2d ( PG_FUNCTION_ARGS  )

Definition at line 1212 of file gserialized_gist_2d.c.

1213 {
1214  GistEntryVector *entryvec = (GistEntryVector *) PG_GETARG_POINTER(0);
1215  int *sizep = (int *) PG_GETARG_POINTER(1); /* Size of the return value */
1216  int numranges, i;
1217  BOX2DF *box_cur, *box_union;
1218 
1219  POSTGIS_DEBUG(4, "[GIST] 'union' function called");
1220 
1221  numranges = entryvec->n;
1222 
1223  box_cur = (BOX2DF*) DatumGetPointer(entryvec->vector[0].key);
1224 
1225  box_union = box2df_copy(box_cur);
1226 
1227  for ( i = 1; i < numranges; i++ )
1228  {
1229  box_cur = (BOX2DF*) DatumGetPointer(entryvec->vector[i].key);
1230  box2df_merge(box_union, box_cur);
1231  }
1232 
1233  *sizep = sizeof(BOX2DF);
1234 
1235  POSTGIS_DEBUGF(4, "[GIST] 'union', numranges(%i), pageunion %s", numranges, box2df_to_string(box_union));
1236 
1237  PG_RETURN_POINTER(box_union);
1238 
1239 }
static char * box2df_to_string(const BOX2DF *a)
void box2df_merge(BOX2DF *b_union, BOX2DF *b_new)
BOX2DF * box2df_copy(BOX2DF *b)

References box2df_copy(), box2df_merge(), and box2df_to_string().

Here is the call graph for this function: