2810 double nodataval = 0;
2815 if (!AggCheckCallContext(fcinfo, NULL)) {
2816 elog(ERROR,
"RASTER_union_finalfn: Cannot be called in a non-aggregate context");
2821 if (PG_ARGISNULL(0))
2828 if (itrset == NULL) {
2830 elog(ERROR,
"RASTER_union_finalfn: Could not allocate memory for iterator arguments");
2834 for (i = 0; i < iwr->
numband; i++) {
2849 itrset[0].
nband = 0;
2851 itrset[1].
nband = 0;
2859 hasnodata, nodataval,
2872 hasnodata, nodataval,
2886 elog(ERROR,
"RASTER_union_finalfn: Could not run raster iterator function");
2897 status = (_rtn == NULL) ? -1 : 0;
2922 elog(ERROR,
"RASTER_union_finalfn: Could not add band to final raster");
2931 if (!_rtn) PG_RETURN_NULL();
2941 SET_VARSIZE(pgraster, pgraster->
size);
2942 PG_RETURN_POINTER(pgraster);
static int rtpg_union_range_callback(rt_iterator_arg arg, void *userarg, double *value, int *nodata)
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
rt_raster rt_raster_from_band(rt_raster raster, uint32_t *bandNums, int count)
Construct a new rt_raster from an existing rt_raster and an array of band numbers.
rtpg_union_band_arg bandarg
#define POSTGIS_RT_DEBUGF(level, msg,...)
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
static int rtpg_union_mean_callback(rt_iterator_arg arg, void *userarg, double *value, int *nodata)
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
int rt_raster_copy_band(rt_raster torast, rt_raster fromrast, int fromindex, int toindex)
Copy one band from one raster to another.
int rt_band_get_hasnodata_flag(rt_band band)
Get hasnodata flag value.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
static void rtpg_union_arg_destroy(rtpg_union_arg arg)
const char * rt_pixtype_name(rt_pixtype pixtype)
rt_errorstate rt_raster_iterator(rt_iterator itrset, uint16_t itrcount, rt_extenttype extenttype, rt_raster customextent, rt_pixtype pixtype, uint8_t hasnodata, double nodataval, uint16_t distancex, uint16_t distancey, rt_mask mask, void *userarg, int(*callback)(rt_iterator_arg arg, void *userarg, double *value, int *nodata), rt_raster *rtnraster)
n-raster iterator.
rt_pixtype rt_band_get_pixtype(rt_band band)
Return pixeltype of this band.
struct rtpg_union_arg_t * rtpg_union_arg
rtpg_union_type uniontype
#define POSTGIS_RT_DEBUG(level, msg)