1104 SPIPlanPtr plan = NULL;
1124 else if (arg->
nodata[0][0][0] && !arg->
nodata[1][0][0]) {
1134 else if (!arg->
nodata[0][0][0] && arg->
nodata[1][0][0]) {
1161 if (arg->
nodata[0][0][0]) {
1197 SPITupleTable *tuptable = NULL;
1200 bool isnull =
false;
1205 memset(values, (Datum) NULL,
sizeof(Datum) * callback->
kw.
count);
1206 memset(nulls,
FALSE,
sizeof(
bool) * callback->
kw.
count);
1211 for (i = 0; i < callback->
kw.
count; i++) {
1213 if (idx < 1)
continue;
1219 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1223 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1229 if (!arg->
nodata[0][0][0])
1230 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1237 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1241 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1247 if (!arg->
nodata[0][0][0])
1248 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1255 values[idx] = Int32GetDatum(arg->
src_pixel[1][0] + 1);
1259 values[idx] = Int32GetDatum(arg->
src_pixel[1][1] + 1);
1265 if (!arg->
nodata[1][0][0])
1266 values[idx] = Float8GetDatum(arg->
values[1][0][0]);
1276 err = SPI_execute_plan(plan, values, nulls,
TRUE, 1);
1277 if (err != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) {
1278 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Unexpected error when running prepared statement %d",
id);
1283 tupdesc = SPI_tuptable->tupdesc;
1284 tuptable = SPI_tuptable;
1285 tuple = tuptable->vals[0];
1287 datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
1288 if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
1289 if (SPI_tuptable) SPI_freetuptable(tuptable);
1290 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Could not get result of prepared statement %d",
id);
1295 *
value = DatumGetFloat8(datum);
1315 if (SPI_tuptable) SPI_freetuptable(tuptable);
struct rtpg_nmapalgebraexpr_callback_arg::@18 kw
#define POSTGIS_RT_DEBUGF(level, msg,...)
struct rtpg_nmapalgebraexpr_callback_arg::@17 nodatanodata
struct rtpg_nmapalgebraexpr_callback_arg::@16 expr[3]
#define POSTGIS_RT_DEBUG(level, msg)