PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ _rti_iterator_arg_empty_init()

static int _rti_iterator_arg_empty_init ( _rti_iterator_arg  _param)
static

Definition at line 681 of file rt_mapalgebra.c.

681 {
682 uint32_t x = 0;
683 uint32_t y = 0;
684
685 _param->empty.values = rtalloc(sizeof(double *) * _param->dimension.rows);
686 _param->empty.nodata = rtalloc(sizeof(int *) * _param->dimension.rows);
687 if (_param->empty.values == NULL || _param->empty.nodata == NULL) {
688 rterror("_rti_iterator_arg_empty_init: Could not allocate memory for empty values and NODATA");
689 return 0;
690 }
691
692 for (y = 0; y < _param->dimension.rows; y++) {
693 _param->empty.values[y] = rtalloc(sizeof(double) * _param->dimension.columns);
694 _param->empty.nodata[y] = rtalloc(sizeof(int) * _param->dimension.columns);
695
696 if (_param->empty.values[y] == NULL || _param->empty.nodata[y] == NULL) {
697 rterror("_rti_iterator_arg_empty_init: Could not allocate memory for elements of empty values and NODATA");
698 return 0;
699 }
700
701 for (x = 0; x < _param->dimension.columns; x++) {
702 _param->empty.values[y][x] = 0;
703 _param->empty.nodata[y][x] = 1;
704 }
705 }
706
707 return 1;
708}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
Definition rt_context.c:191
struct _rti_iterator_arg_t::@18 dimension
struct _rti_iterator_arg_t::@19 empty

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(), and _rti_iterator_arg_t::values.

Referenced by rt_raster_iterator().

Here is the call graph for this function:
Here is the caller graph for this function: