PostGIS  2.1.10dev-r@@SVN_REVISION@@
static int _rti_iterator_arg_empty_init ( _rti_iterator_arg  _param)
static

Definition at line 13786 of file rt_api.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, pixval::x, and pixval::y.

Referenced by rt_raster_iterator().

13786  {
13787  int x = 0;
13788  int y = 0;
13789 
13790  _param->empty.values = rtalloc(sizeof(double *) * _param->dimension.rows);
13791  _param->empty.nodata = rtalloc(sizeof(int *) * _param->dimension.rows);
13792  if (_param->empty.values == NULL || _param->empty.nodata == NULL) {
13793  rterror("_rti_iterator_arg_empty_init: Could not allocate memory for empty values and NODATA");
13794  return 0;
13795  }
13796 
13797  for (y = 0; y < _param->dimension.rows; y++) {
13798  _param->empty.values[y] = rtalloc(sizeof(double) * _param->dimension.columns);
13799  _param->empty.nodata[y] = rtalloc(sizeof(int) * _param->dimension.columns);
13800 
13801  if (_param->empty.values[y] == NULL || _param->empty.nodata[y] == NULL) {
13802  rterror("_rti_iterator_arg_empty_init: Could not allocate memory for elements of empty values and NODATA");
13803  return 0;
13804  }
13805 
13806  for (x = 0; x < _param->dimension.columns; x++) {
13807  _param->empty.values[y][x] = 0;
13808  _param->empty.nodata[y][x] = 1;
13809  }
13810  }
13811 
13812  return 1;
13813 }
double ** values
Definition: rt_api.c:13530
struct _rti_iterator_arg_t::@13 empty
tuple x
Definition: pixval.py:53
uint32_t columns
Definition: rt_api.c:13526
void * rtalloc(size_t size)
Raster core memory management functions.
Definition: rt_api.c:867
void rterror(const char *fmt,...)
Raster core error and info handlers.
Definition: rt_api.c:895
struct _rti_iterator_arg_t::@12 dimension
tuple y
Definition: pixval.py:54

Here is the call graph for this function:

Here is the caller graph for this function: