PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ rtpg_union_range_callback()

static int rtpg_union_range_callback ( rt_iterator_arg  arg,
void *  userarg,
double *  value,
int *  nodata 
)
static

Definition at line 1923 of file rtpg_mapalgebra.c.

1926  {
1927  if (arg == NULL)
1928  return 0;
1929 
1930  if (
1931  arg->rasters != 2 ||
1932  arg->rows != 1 ||
1933  arg->columns != 1
1934  ) {
1935  elog(ERROR, "rtpg_union_range_callback: Invalid arguments passed to callback");
1936  return 0;
1937  }
1938 
1939  *value = 0;
1940  *nodata = 1;
1941 
1942  POSTGIS_RT_DEBUGF(4, "rast0: %f %d", arg->values[0][0][0], arg->nodata[0][0][0]);
1943  POSTGIS_RT_DEBUGF(4, "rast1: %f %d", arg->values[1][0][0], arg->nodata[1][0][0]);
1944 
1945  if (
1946  !arg->nodata[0][0][0] &&
1947  !arg->nodata[1][0][0]
1948  ) {
1949  *value = arg->values[1][0][0] - arg->values[0][0][0];
1950  *nodata = 0;
1951  }
1952 
1953  POSTGIS_RT_DEBUGF(4, "value, nodata = (%f, %d)", *value, *nodata);
1954 
1955  return 1;
1956 }
int value
Definition: genraster.py:61
#define POSTGIS_RT_DEBUGF(level, msg,...)
Definition: rtpostgis.h:65
double *** values
Definition: librtcore.h:2459
uint32_t columns
Definition: librtcore.h:2455
uint16_t rasters
Definition: librtcore.h:2451

References rt_iterator_arg_t::columns, rt_iterator_arg_t::nodata, POSTGIS_RT_DEBUGF, rt_iterator_arg_t::rasters, rt_iterator_arg_t::rows, genraster::value, and rt_iterator_arg_t::values.

Referenced by RASTER_union_finalfn().

Here is the caller graph for this function: