536 {
537 int i = 0;
538 int hasband = 0;
539
540 _param->
count = itrcount;
545
546
551
553
559
560 if (
563 _param->
width == NULL ||
571 ) {
572 rterror(
"_rti_iterator_arg_populate: Could not allocate memory for children of _rti_iterator_arg");
573 return 0;
574 }
575
576 *allnull = 0;
577 *allempty = 0;
578
579
580
581
582
583
584 for (i = 0; i < itrcount; i++) {
585
588 _param->
width[i] = 0;
590
592
598
599
600 if (itrset[i].raster == NULL) {
602
603 (*allnull)++;
604 (*allempty)++;
605
606 continue;
607 }
610
611 (*allempty)++;
612
613 continue;
614 }
615
616
618 if (!hasband) {
619 if (!itrset[i].nbnodata) {
620 rterror(
"_rti_iterator_arg_populate: Band %d not found for raster %d", itrset[i].nband, i);
621 return 0;
622 }
623 else {
624 RASTER_DEBUGF(4,
"Band %d not found for raster %d. Using NODATA", itrset[i].nband, i);
625 }
626 }
627
629 if (hasband) {
632 rterror(
"_rti_iterator_arg_populate: Could not get band %d for raster %d", itrset[i].nband, i);
633 return 0;
634 }
635
636
638
639
641
643
644
646 }
647
648 else {
649
651 }
652 }
653
654
657
658
660 if (_param->
offset[i] == NULL) {
661 rterror(
"_rti_iterator_arg_populate: Could not allocate memory for offsets");
662 return 0;
663 }
664 }
665
666 return 1;
667}
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
#define RASTER_DEBUGF(level, msg,...)
int rt_band_get_hasnodata_flag(rt_band band)
Get hasnodata flag value.
int rt_band_get_isnodata_flag(rt_band band)
Get isnodata flag value.
int rt_raster_has_band(rt_raster raster, int nband)
Return TRUE if the raster has a band of this number.
double rt_band_get_min_value(rt_band band)
Returns the minimal possible value for the band according to the pixel type.
uint16_t rt_raster_get_height(rt_raster raster)
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
uint16_t rt_raster_get_width(rt_raster raster)
int rt_raster_is_empty(rt_raster raster)
Return TRUE if the raster is empty.
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
struct _rti_iterator_arg_t::@10 band
struct _rti_iterator_arg_t::@11 distance
struct _rti_iterator_arg_t::@12 dimension