49 {
50 double xr;
51 double yr;
52 double xw;
53 double yw;
54 int err = 0;
55
56 assert(NULL != rast1);
57 assert(NULL != rast2);
58 assert(NULL != aligned);
59
60 err = 0;
61
63 if (reason != NULL) *reason = "The rasters have different SRIDs";
64 err = 1;
65 }
66
68 if (reason != NULL) *reason = "The rasters have different scales on the X axis";
69 err = 1;
70 }
72 if (reason != NULL) *reason = "The rasters have different scales on the Y axis";
73 err = 1;
74 }
75
77 if (reason != NULL) *reason = "The rasters have different skews on the X axis";
78 err = 1;
79 }
81 if (reason != NULL) *reason = "The rasters have different skews on the Y axis";
82 err = 1;
83 }
84
85 if (err) {
86 *aligned = 0;
88 }
89
90
92 rast2,
94 &xr, &yr,
95 NULL
97 rterror(
"rt_raster_same_alignment: Could not get raster coordinates of second raster from first raster's spatial coordinates");
98 *aligned = 0;
100 }
101
102
104 rast2,
105 xr, yr,
106 &xw, &yw,
107 NULL
109 rterror(
"rt_raster_same_alignment: Could not get spatial coordinates of second raster from raster coordinates");
110 *aligned = 0;
112 }
113
117
118
120 if (reason != NULL) *reason = "The rasters are aligned";
121 *aligned = 1;
123 }
124
125
126 if (reason != NULL) *reason = "The rasters (pixel corner coordinates) are not aligned";
127
128 *aligned = 0;
130}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
rt_errorstate rt_raster_cell_to_geopoint(rt_raster raster, double xr, double yr, double *xw, double *yw, double *gt)
Convert an xr, yr raster point to an xw, yw point on map.
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
#define RASTER_DEBUGF(level, msg,...)
rt_errorstate rt_raster_geopoint_to_cell(rt_raster raster, double xw, double yw, double *xr, double *yr, double *igt)
Convert an xw, yw map point to a xr, yr raster point.