PostGIS  2.5.0dev-r@@SVN_REVISION@@
static rtpg_summarystats_arg rtpg_summarystats_arg_init ( )
static

Definition at line 522 of file rtpg_statistics.c.

References rtpg_summarystats_arg_t::band_index, rtpg_summarystats_arg_t::cK, rtpg_summarystats_arg_t::cM, rt_bandstats_t::count, rtpg_summarystats_arg_t::cQ, rtpg_summarystats_arg_t::exclude_nodata_value, rt_bandstats_t::max, rt_bandstats_t::mean, rt_bandstats_t::min, rtpg_summarystats_arg_destroy(), rtpg_summarystats_arg_t::sample, rt_bandstats_t::sample, rt_bandstats_t::sorted, rtpg_summarystats_arg_t::stats, rt_bandstats_t::stddev, rt_bandstats_t::sum, TRUE, and rt_bandstats_t::values.

Referenced by RASTER_summaryStats_transfn().

522  {
523  rtpg_summarystats_arg arg = NULL;
524 
525  arg = palloc(sizeof(struct rtpg_summarystats_arg_t));
526  if (arg == NULL) {
527  elog(
528  ERROR,
529  "rtpg_summarystats_arg_init: Cannot allocate memory for function arguments"
530  );
531  return NULL;
532  }
533 
534  arg->stats = (rt_bandstats) palloc(sizeof(struct rt_bandstats_t));
535  if (arg->stats == NULL) {
537  elog(
538  ERROR,
539  "rtpg_summarystats_arg_init: Cannot allocate memory for stats function argument"
540  );
541  return NULL;
542  }
543 
544  arg->stats->sample = 0;
545  arg->stats->count = 0;
546  arg->stats->min = 0;
547  arg->stats->max = 0;
548  arg->stats->sum = 0;
549  arg->stats->mean = 0;
550  arg->stats->stddev = -1;
551  arg->stats->values = NULL;
552  arg->stats->sorted = 0;
553 
554  arg->cK = 0;
555  arg->cM = 0;
556  arg->cQ = 0;
557 
558  arg->band_index = 1;
559  arg->exclude_nodata_value = TRUE;
560  arg->sample = 1;
561 
562  return arg;
563 }
uint32_t count
Definition: librtcore.h:2311
double * values
Definition: librtcore.h:2319
struct rt_bandstats_t * rt_bandstats
Definition: librtcore.h:150
static void rtpg_summarystats_arg_destroy(rtpg_summarystats_arg arg)
#define TRUE
Definition: dbfopen.c:169

Here is the call graph for this function:

Here is the caller graph for this function: