1111 SPIPlanPtr plan = NULL;
1131 else if (arg->
nodata[0][0][0] && !arg->
nodata[1][0][0]) {
1141 else if (!arg->
nodata[0][0][0] && arg->
nodata[1][0][0]) {
1168 if (arg->
nodata[0][0][0]) {
1204 SPITupleTable *tuptable = NULL;
1207 bool isnull =
FALSE;
1212 memset(values, (Datum) NULL,
sizeof(Datum) * callback->
kw.
count);
1213 memset(nulls,
FALSE,
sizeof(
char) * callback->
kw.
count);
1218 for (i = 0; i < callback->
kw.
count; i++) {
1220 if (idx < 1)
continue;
1226 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1230 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1236 if (!arg->
nodata[0][0][0])
1237 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1244 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1248 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1254 if (!arg->
nodata[0][0][0])
1255 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1262 values[idx] = Int32GetDatum(arg->
src_pixel[1][0] + 1);
1266 values[idx] = Int32GetDatum(arg->
src_pixel[1][1] + 1);
1272 if (!arg->
nodata[1][0][0])
1273 values[idx] = Float8GetDatum(arg->
values[1][0][0]);
1283 err = SPI_execute_plan(plan, values, nulls,
TRUE, 1);
1284 if (err != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) {
1285 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Unexpected error when running prepared statement %d",
id);
1290 tupdesc = SPI_tuptable->tupdesc;
1291 tuptable = SPI_tuptable;
1292 tuple = tuptable->vals[0];
1294 datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
1295 if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
1296 if (SPI_tuptable) SPI_freetuptable(tuptable);
1297 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Could not get result of prepared statement %d",
id);
1302 *
value = DatumGetFloat8(datum);
1322 if (SPI_tuptable) SPI_freetuptable(tuptable);
#define POSTGIS_RT_DEBUG(level, msg)
#define POSTGIS_RT_DEBUGF(level, msg,...)
struct rtpg_nmapalgebraexpr_callback_arg::@18 expr[3]
struct rtpg_nmapalgebraexpr_callback_arg::@20 kw
struct rtpg_nmapalgebraexpr_callback_arg::@19 nodatanodata