PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ pgis_geometry_clusterwithin_finalfn()

Datum pgis_geometry_clusterwithin_finalfn ( PG_FUNCTION_ARGS  )

Definition at line 356 of file lwgeom_accum.c.

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

Referenced by pgis_geometry_clusterintersecting_finalfn().

357 {
358  pgis_abs *p;
359  Datum result = 0;
360  Datum geometry_array = 0;
361 
362  if (PG_ARGISNULL(0))
363  PG_RETURN_NULL();
364 
365  p = (pgis_abs*) PG_GETARG_POINTER(0);
366 
367  if (!p->data)
368  {
369  elog(ERROR, "Tolerance not defined");
370  PG_RETURN_NULL();
371  }
372 
373  geometry_array = pgis_accum_finalfn(p, CurrentMemoryContext, fcinfo);
374  result = PGISDirectFunctionCall2( cluster_within_distance_garray, geometry_array, p->data);
375  if (!result)
376  PG_RETURN_NULL();
377 
378  PG_RETURN_DATUM(result);
379 }
Datum pgis_accum_finalfn(pgis_abs *p, MemoryContext mctx, FunctionCallInfo fcinfo)
Datum data
Definition: lwgeom_accum.c:110
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:412
To pass the internal ArrayBuildState pointer between the transfn and finalfn we need to wrap it into ...
Definition: lwgeom_accum.c:107
Here is the call graph for this function:
Here is the caller graph for this function: