1070 SPIPlanPtr plan = NULL;
1090 else if (arg->
nodata[0][0][0] && !arg->
nodata[1][0][0]) {
1100 else if (!arg->
nodata[0][0][0] && arg->
nodata[1][0][0]) {
1127 if (arg->
nodata[0][0][0]) {
1163 SPITupleTable *tuptable = NULL;
1166 bool isnull =
FALSE;
1171 memset(values, (Datum) NULL,
sizeof(Datum) * callback->
kw.
count);
1172 memset(nulls,
FALSE,
sizeof(
char) * callback->
kw.
count);
1177 for (i = 0; i < callback->
kw.
count; i++) {
1179 if (idx < 1)
continue;
1185 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1189 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1195 if (!arg->
nodata[0][0][0])
1196 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1203 values[idx] = Int32GetDatum(arg->
src_pixel[0][0] + 1);
1207 values[idx] = Int32GetDatum(arg->
src_pixel[0][1] + 1);
1213 if (!arg->
nodata[0][0][0])
1214 values[idx] = Float8GetDatum(arg->
values[0][0][0]);
1221 values[idx] = Int32GetDatum(arg->
src_pixel[1][0] + 1);
1225 values[idx] = Int32GetDatum(arg->
src_pixel[1][1] + 1);
1231 if (!arg->
nodata[1][0][0])
1232 values[idx] = Float8GetDatum(arg->
values[1][0][0]);
1242 err = SPI_execute_plan(plan, values, nulls,
TRUE, 1);
1243 if (err != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) {
1244 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Unexpected error when running prepared statement %d",
id);
1249 tupdesc = SPI_tuptable->tupdesc;
1250 tuptable = SPI_tuptable;
1251 tuple = tuptable->vals[0];
1253 datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
1254 if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
1255 if (SPI_tuptable) SPI_freetuptable(tuptable);
1256 elog(ERROR,
"rtpg_nmapalgebraexpr_callback: Could not get result of prepared statement %d",
id);
1261 *
value = DatumGetFloat8(datum);
1281 if (SPI_tuptable) SPI_freetuptable(tuptable);
#define POSTGIS_RT_DEBUG(level, msg)
#define POSTGIS_RT_DEBUGF(level, msg,...)
struct rtpg_nmapalgebraexpr_callback_arg::@26 kw
struct rtpg_nmapalgebraexpr_callback_arg::@24 expr[3]
struct rtpg_nmapalgebraexpr_callback_arg::@25 nodatanodata