PostGIS  2.2.7dev-r@@SVN_REVISION@@
Datum pgis_geometry_clusterwithin_finalfn ( PG_FUNCTION_ARGS  )

Definition at line 340 of file lwgeom_accum.c.

References cluster_within_distance_garray(), pgis_abs::data, pgis_accum_finalfn(), and PGISDirectFunctionCall2().

341 {
342  pgis_abs *p;
343  Datum result = 0;
344  Datum geometry_array = 0;
345 
346  if (PG_ARGISNULL(0))
347  PG_RETURN_NULL();
348 
349  p = (pgis_abs*) PG_GETARG_POINTER(0);
350 
351  if (!p->data)
352  {
353  elog(ERROR, "Tolerance not defined");
354  PG_RETURN_NULL();
355  }
356 
357  geometry_array = pgis_accum_finalfn(p, CurrentMemoryContext, fcinfo);
358  result = PGISDirectFunctionCall2( cluster_within_distance_garray, geometry_array, p->data);
359  if (!result)
360  PG_RETURN_NULL();
361 
362  PG_RETURN_DATUM(result);
363 }
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 data
Definition: lwgeom_accum.c:72
Datum cluster_within_distance_garray(PG_FUNCTION_ARGS)
Datum PGISDirectFunctionCall2(PGFunction func, Datum arg1, Datum arg2)
A modified version of PostgreSQL's DirectFunctionCall2 which allows NULL results; this is required fo...
Definition: lwgeom_accum.c:400
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: