*
* @return the default set of or requested quantiles for a band
*/
-rt_quantile rt_band_get_quantiles_stream(rt_band band,
+rt_quantile
+rt_band_get_quantiles_stream(rt_band band,
int exclude_nodata_value, double sample,
uint64_t cov_count,
struct quantile_llist **qlls, int *qlls_count,
rtn = rtalloc(sizeof(struct rt_quantile_t) * *rtn_count);
if (NULL == rtn) return NULL;
+ RASTER_DEBUGF(3, "returning %d quantiles", *rtn_count);
for (i = 0, k = 0; i < *qlls_count; i++) {
qll = &((*qlls)[i]);
k++;
}
+ RASTER_DEBUG(3, "done");
return rtn;
}
MemoryContextSwitchTo(oldcontext);
}
- /* stuff done on every call of the function */
- funcctx = SRF_PERCALL_SETUP();
+ /* stuff done on every call of the function */
+ funcctx = SRF_PERCALL_SETUP();
call_cntr = funcctx->call_cntr;
max_calls = funcctx->max_calls;
SPI_finish();
if (bin_width_count) pfree(bin_width);
+ pfree(hist);
SRF_RETURN_DONE(funcctx);
}
MemoryContextSwitchTo(oldcontext);
}
- /* stuff done on every call of the function */
- funcctx = SRF_PERCALL_SETUP();
+ /* stuff done on every call of the function */
+ funcctx = SRF_PERCALL_SETUP();
call_cntr = funcctx->call_cntr;
max_calls = funcctx->max_calls;
MemoryContextSwitchTo(oldcontext);
}
- /* stuff done on every call of the function */
- funcctx = SRF_PERCALL_SETUP();
+ /* stuff done on every call of the function */
+ funcctx = SRF_PERCALL_SETUP();
call_cntr = funcctx->call_cntr;
max_calls = funcctx->max_calls;
SRF_RETURN_DONE(funcctx);
}
cov_count = strtol(tmp, NULL, 10);
- POSTGIS_RT_DEBUGF(3, "RASTER_quantileCoverage: covcount = %d", covcount);
+ POSTGIS_RT_DEBUGF(3, "RASTER_quantileCoverage: covcount = %d", cov_count);
pfree(tmp);
/* iterate through rasters of coverage */
SPI_finish();
quantile_llist_destroy(&qlls, qlls_count);
+ if (quantiles_count) pfree(quantiles);
+
+ POSTGIS_RT_DEBUGF(3, "%d quantiles returned", count);
/* Store needed information */
funcctx->user_fctx = covquant;
MemoryContextSwitchTo(oldcontext);
}
- /* stuff done on every call of the function */
- funcctx = SRF_PERCALL_SETUP();
+ /* stuff done on every call of the function */
+ funcctx = SRF_PERCALL_SETUP();
call_cntr = funcctx->call_cntr;
max_calls = funcctx->max_calls;
}
/* do when there is no more left */
else {
+ POSTGIS_RT_DEBUG(3, "done");
pfree(covquant2);
SRF_RETURN_DONE(funcctx);
}
MemoryContextSwitchTo(oldcontext);
}
- /* stuff done on every call of the function */
- funcctx = SRF_PERCALL_SETUP();
+ /* stuff done on every call of the function */
+ funcctx = SRF_PERCALL_SETUP();
call_cntr = funcctx->call_cntr;
max_calls = funcctx->max_calls;
MemoryContextSwitchTo(oldcontext);
}
- /* stuff done on every call of the function */
- funcctx = SRF_PERCALL_SETUP();
+ /* stuff done on every call of the function */
+ funcctx = SRF_PERCALL_SETUP();
call_cntr = funcctx->call_cntr;
max_calls = funcctx->max_calls;