PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum pgis_geometry_union_finalfn ( PG_FUNCTION_ARGS  )

Definition at line 190 of file lwgeom_accum.c.

References pgis_accum_finalfn(), pgis_union_geometry_array(), PGISDirectFunctionCall1(), and result.

191 {
192  pgis_abs *p;
193  Datum result = 0;
194  Datum geometry_array = 0;
195 
196  if (PG_ARGISNULL(0))
197  PG_RETURN_NULL(); /* returns null iff no input values */
198 
199  p = (pgis_abs*) PG_GETARG_POINTER(0);
200 
201  geometry_array = pgis_accum_finalfn(p, CurrentMemoryContext, fcinfo);
202  result = PGISDirectFunctionCall1( pgis_union_geometry_array, geometry_array );
203  if (!result)
204  PG_RETURN_NULL();
205 
206  PG_RETURN_DATUM(result);
207 }
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:143
Datum pgis_union_geometry_array(PG_FUNCTION_ARGS)
char ** result
Definition: liblwgeom.h:218
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:287
To pass the internal ArrayBuildState pointer between the transfn and finalfn we need to wrap it into ...
Definition: lwgeom_accum.c:61

Here is the call graph for this function: