PostGIS  2.1.10dev-r@@SVN_REVISION@@
static int rtpg_union_range_callback ( rt_iterator_arg  arg,
void *  userarg,
double *  value,
int *  nodata 
)
static

Definition at line 17922 of file rt_pg.c.

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

Referenced by RASTER_union_finalfn().

17925  {
17926  if (arg == NULL)
17927  return 0;
17928 
17929  if (
17930  arg->rasters != 2 ||
17931  arg->rows != 1 ||
17932  arg->columns != 1
17933  ) {
17934  elog(ERROR, "rtpg_union_range_callback: Invalid arguments passed to callback");
17935  return 0;
17936  }
17937 
17938  *value = 0;
17939  *nodata = 1;
17940 
17941  POSTGIS_RT_DEBUGF(4, "rast0: %f %d", arg->values[0][0][0], arg->nodata[0][0][0]);
17942  POSTGIS_RT_DEBUGF(4, "rast1: %f %d", arg->values[1][0][0], arg->nodata[1][0][0]);
17943 
17944  if (
17945  !arg->nodata[0][0][0] &&
17946  !arg->nodata[1][0][0]
17947  ) {
17948  *value = arg->values[1][0][0] - arg->values[0][0][0];
17949  *nodata = 0;
17950  }
17951 
17952  POSTGIS_RT_DEBUGF(4, "value, nodata = (%f, %d)", *value, *nodata);
17953 
17954  return 1;
17955 }
uint32_t rows
Definition: rt_api.h:2370
uint32_t columns
Definition: rt_api.h:2372
uint16_t rasters
Definition: rt_api.h:2368
double *** values
Definition: rt_api.h:2376
#define POSTGIS_RT_DEBUGF(level, msg,...)
Definition: rt_pg.h:62
int *** nodata
Definition: rt_api.h:2378

Here is the caller graph for this function: