1113 SPIPlanPtr plan = NULL;
1133 else if (arg->
nodata[0][0][0] && !arg->
nodata[1][0][0]) {
1143 else if (!arg->
nodata[0][0][0] && arg->
nodata[1][0][0]) {
1170 if (arg->
nodata[0][0][0]) {
1206 SPITupleTable *tuptable = NULL;
1209 bool isnull =
FALSE;
1214 memset(values, (Datum) NULL,
sizeof(Datum) * callback->
kw.
count);
1215 memset(nulls,
FALSE,
sizeof(
char) * callback->
kw.
count);
1220 for (i = 0; i < callback->
kw.
count; i++) {
1222 if (idx < 1)
continue;
1228 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1232 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1238 if (!arg->
nodata[0][0][0])
1239 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1246 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1250 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1256 if (!arg->
nodata[0][0][0])
1257 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1264 values[idx] = Int32GetDatum(arg->
src_pixel[1][0] + 1);
1268 values[idx] = Int32GetDatum(arg->
src_pixel[1][1] + 1);
1274 if (!arg->
nodata[1][0][0])
1275 values[idx] = Float8GetDatum(arg->
values[1][0][0]);
1285 err = SPI_execute_plan(plan, values, nulls,
TRUE, 1);
1286 if (err != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) {
1287 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Unexpected error when running prepared statement %d",
id);
1292 tupdesc = SPI_tuptable->tupdesc;
1293 tuptable = SPI_tuptable;
1294 tuple = tuptable->vals[0];
1296 datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
1297 if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
1298 if (SPI_tuptable) SPI_freetuptable(tuptable);
1299 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Could not get result of prepared statement %d",
id);
1304 *
value = DatumGetFloat8(datum);
1324 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