589 {
590 static uint8_t msg[6] = {0};
591 uint32_t i = 0;
592
593
594 if (
595 !msg[0] &&
597 ) {
598 rtwarn(
_(
"Different number of bands found in the set of rasters being converted to PostGIS raster"));
599 msg[0]++;
600 }
601
602
603 if (!msg[1]) {
605 if (
x->bandtype[i] != ref->
bandtype[i]) {
606 rtwarn(
_(
"Different pixel types found for band %d in the set of rasters being converted to PostGIS raster"), ref->
nband[i]);
607 msg[1]++;
608 }
609 }
610 }
611
612
613 if (!msg[2]) {
616 rtwarn(
_(
"Different hasnodata flags found for band %d in the set of rasters being converted to PostGIS raster"), ref->
nband[i]);
617 msg[2]++;
618 }
619 }
620 }
621
622
623 if (!msg[3]) {
625 if (!
x->hasnodata[i] && !ref->
hasnodata[i])
continue;
627 rtwarn(
_(
"Different NODATA values found for band %d in the set of rasters being converted to PostGIS raster"), ref->
nband[i]);
628 msg[3]++;
629 }
630 }
631 }
632
633
634 if (!msg[4]) {
637 int err;
638 int aligned;
639
640 if (
643 ) {
644 rterror(
_(
"diff_rastinfo: Could not allocate memory for raster alignment test"));
647 return;
648 }
649
652
657 rterror(
_(
"diff_rastinfo: Could not run raster alignment test"));
658 return;
659 }
660
661 if (!aligned) {
662 rtwarn(
_(
"Raster with different alignment found in the set of rasters being converted to PostGIS raster"));
663 msg[4]++;
664 }
665 }
666
667
668 if (!msg[5]) {
669 for (i = 0; i < 2; i++) {
671 rtwarn(
_(
"Different tile sizes found in the set of rasters being converted to PostGIS raster"));
672 msg[5]++;
673 break;
674 }
675 }
676 }
677}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
void rt_raster_set_geotransform_matrix(rt_raster raster, double *gt)
Set raster's geotransform using 6-element array.
void void void rtwarn(const char *fmt,...) __attribute__((format(printf
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
rt_errorstate rt_raster_same_alignment(rt_raster rast1, rt_raster rast2, int *aligned, char **reason)