1071 SPIPlanPtr plan = NULL;
1091 else if (arg->
nodata[0][0][0] && !arg->
nodata[1][0][0]) {
1101 else if (!arg->
nodata[0][0][0] && arg->
nodata[1][0][0]) {
1128 if (arg->
nodata[0][0][0]) {
1164 SPITupleTable *tuptable = NULL;
1167 bool isnull =
FALSE;
1172 memset(values, (Datum) NULL,
sizeof(Datum) * callback->
kw.
count);
1173 memset(nulls,
FALSE,
sizeof(
char) * callback->
kw.
count);
1178 for (i = 0; i < callback->
kw.
count; i++) {
1180 if (idx < 1)
continue;
1183 if (arg->
rasters == 1 && i > 7) {
1184 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster invocation");
1191 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1195 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1201 if (!arg->
nodata[0][0][0])
1202 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1209 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1213 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1219 if (!arg->
nodata[0][0][0])
1220 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1227 values[idx] = Int32GetDatum(arg->
src_pixel[1][0] + 1);
1231 values[idx] = Int32GetDatum(arg->
src_pixel[1][1] + 1);
1237 if (!arg->
nodata[1][0][0])
1238 values[idx] = Float8GetDatum(arg->
values[1][0][0]);
1248 err = SPI_execute_plan(plan, values, nulls,
TRUE, 1);
1249 if (err != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) {
1250 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Unexpected error when running prepared statement %d",
id);
1255 tupdesc = SPI_tuptable->tupdesc;
1256 tuptable = SPI_tuptable;
1257 tuple = tuptable->vals[0];
1259 datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
1260 if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
1261 if (SPI_tuptable) SPI_freetuptable(tuptable);
1262 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Could not get result of prepared statement %d",
id);
1267 *
value = DatumGetFloat8(datum);
1287 if (SPI_tuptable) SPI_freetuptable(tuptable);
#define POSTGIS_RT_DEBUG(level, msg)
#define POSTGIS_RT_DEBUGF(level, msg,...)
struct rtpg_nmapalgebraexpr_callback_arg::@26 nodatanodata
struct rtpg_nmapalgebraexpr_callback_arg::@25 expr[3]
struct rtpg_nmapalgebraexpr_callback_arg::@27 kw