2819 double nodataval = 0;
2824 if (!AggCheckCallContext(fcinfo, NULL)) {
2825 elog(ERROR,
"RASTER_union_finalfn: Cannot be called in a non-aggregate context");
2830 if (PG_ARGISNULL(0))
2837 if (itrset == NULL) {
2839 elog(ERROR,
"RASTER_union_finalfn: Could not allocate memory for iterator arguments");
2843 for (i = 0; i < iwr->
numband; i++) {
2858 itrset[0].
nband = 0;
2860 itrset[1].
nband = 0;
2868 hasnodata, nodataval,
2881 hasnodata, nodataval,
2895 elog(ERROR,
"RASTER_union_finalfn: Could not run raster iterator function");
2901 if (_raster == NULL)
2909 status = (_rtn == NULL) ? -1 : 0;
2934 elog(ERROR,
"RASTER_union_finalfn: Could not add band to final raster");
2943 if (!_rtn) PG_RETURN_NULL();
2953 SET_VARSIZE(pgraster, pgraster->
size);
2954 PG_RETURN_POINTER(pgraster);
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.
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
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_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.
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
rt_pixtype rt_band_get_pixtype(rt_band band)
Return pixeltype of this band.
const char * rt_pixtype_name(rt_pixtype pixtype)
int rt_raster_copy_band(rt_raster torast, rt_raster fromrast, int fromindex, int toindex)
Copy one band from one raster to another.
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
static int rtpg_union_mean_callback(rt_iterator_arg arg, void *userarg, double *value, int *nodata)
static int rtpg_union_range_callback(rt_iterator_arg arg, void *userarg, double *value, int *nodata)
static void rtpg_union_arg_destroy(rtpg_union_arg arg)
struct rtpg_union_arg_t * rtpg_union_arg
#define POSTGIS_RT_DEBUG(level, msg)
#define POSTGIS_RT_DEBUGF(level, msg,...)
rtpg_union_band_arg bandarg
rtpg_union_type uniontype