PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ _rti_iterator_arg_empty_init()

static int _rti_iterator_arg_empty_init ( _rti_iterator_arg  _param)
static

Definition at line 670 of file rt_mapalgebra.c.

References _rti_iterator_arg_t::columns, _rti_iterator_arg_t::dimension, _rti_iterator_arg_t::empty, _rti_iterator_arg_t::nodata, _rti_iterator_arg_t::rows, rtalloc(), rterror(), _rti_iterator_arg_t::values, _rti_iterator_arg_t::x, and _rti_iterator_arg_t::y.

Referenced by rt_raster_iterator().

670  {
671  int x = 0;
672  int y = 0;
673 
674  _param->empty.values = rtalloc(sizeof(double *) * _param->dimension.rows);
675  _param->empty.nodata = rtalloc(sizeof(int *) * _param->dimension.rows);
676  if (_param->empty.values == NULL || _param->empty.nodata == NULL) {
677  rterror("_rti_iterator_arg_empty_init: Could not allocate memory for empty values and NODATA");
678  return 0;
679  }
680 
681  for (y = 0; y < _param->dimension.rows; y++) {
682  _param->empty.values[y] = rtalloc(sizeof(double) * _param->dimension.columns);
683  _param->empty.nodata[y] = rtalloc(sizeof(int) * _param->dimension.columns);
684 
685  if (_param->empty.values[y] == NULL || _param->empty.nodata[y] == NULL) {
686  rterror("_rti_iterator_arg_empty_init: Could not allocate memory for elements of empty values and NODATA");
687  return 0;
688  }
689 
690  for (x = 0; x < _param->dimension.columns; x++) {
691  _param->empty.values[y][x] = 0;
692  _param->empty.nodata[y][x] = 1;
693  }
694  }
695 
696  return 1;
697 }
struct _rti_iterator_arg_t::@10 dimension
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
Definition: rt_context.c:199
void * rtalloc(size_t size)
Wrappers used for managing memory.
Definition: rt_context.c:171
struct _rti_iterator_arg_t::@11 empty
Here is the call graph for this function:
Here is the caller graph for this function: