PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ pgis_geometry_union_finalfn()

Datum pgis_geometry_union_finalfn ( PG_FUNCTION_ARGS  )

Definition at line 215 of file lwgeom_accum.c.

References PG_FUNCTION_INFO_V1(), pgis_accum_finalfn(), pgis_geometry_collect_finalfn(), pgis_union_geometry_array(), and PGISDirectFunctionCall1().

Referenced by pgis_geometry_accum_finalfn().

216 {
217  pgis_abs *p;
218  Datum result = 0;
219  Datum geometry_array = 0;
220 
221  if (PG_ARGISNULL(0))
222  PG_RETURN_NULL(); /* returns null iff no input values */
223 
224  p = (pgis_abs*) PG_GETARG_POINTER(0);
225 
226  geometry_array = pgis_accum_finalfn(p, CurrentMemoryContext, fcinfo);
227  result = PGISDirectFunctionCall1( pgis_union_geometry_array, geometry_array );
228  if (!result)
229  PG_RETURN_NULL();
230 
231  PG_RETURN_DATUM(result);
232 }
Datum pgis_accum_finalfn(pgis_abs *p, MemoryContext mctx, FunctionCallInfo fcinfo)
The final function rescues the built array from the side memory context using the PostgreSQL built-in...
Definition: lwgeom_accum.c:168
Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
Datum PGISDirectFunctionCall1(PGFunction func, Datum arg1)
A modified version of PostgreSQL's DirectFunctionCall1 which allows NULL results; this is required fo...
Definition: lwgeom_accum.c:370
To pass the internal ArrayBuildState pointer between the transfn and finalfn we need to wrap it into ...
Definition: lwgeom_accum.c:69
Here is the call graph for this function:
Here is the caller graph for this function: