PostGIS  2.3.7dev-r@@SVN_REVISION@@
static void test_raster_compute_skewed_raster ( )
static

Definition at line 178 of file cu_raster_misc.c.

References cu_free_raster(), rt_envelope::MaxX, rt_envelope::MaxY, rt_envelope::MinX, rt_envelope::MinY, rtpixdump::rast, rt_raster_compute_skewed_raster(), rt_raster_get_height(), rt_raster_get_width(), rt_raster_get_x_offset(), rt_raster_get_y_offset(), rt_envelope::UpperLeftX, and rt_envelope::UpperLeftY.

Referenced by raster_misc_suite_setup().

178  {
179  rt_envelope extent;
180  rt_raster rast;
181  double skew[2] = {0.25, 0.25};
182  double scale[2] = {1, -1};
183 
184  extent.MinX = 0;
185  extent.MaxY = 0;
186  extent.MaxX = 2;
187  extent.MinY = -2;
188  extent.UpperLeftX = extent.MinX;
189  extent.UpperLeftY = extent.MaxY;
190 
192  extent,
193  skew,
194  scale,
195  0
196  );
197 
198  CU_ASSERT(rast != NULL);
199  CU_ASSERT_EQUAL(rt_raster_get_width(rast), 2);
200  CU_ASSERT_EQUAL(rt_raster_get_height(rast), 3);
201  CU_ASSERT_DOUBLE_EQUAL(rt_raster_get_x_offset(rast), -0.5, DBL_EPSILON);
202  CU_ASSERT_DOUBLE_EQUAL(rt_raster_get_y_offset(rast), 0, DBL_EPSILON);
203 
204  cu_free_raster(rast);
205 }
double MinY
Definition: librtcore.h:179
double UpperLeftX
Definition: librtcore.h:182
double rt_raster_get_x_offset(rt_raster raster)
Get raster x offset, in projection units.
Definition: rt_raster.c:213
double MaxY
Definition: librtcore.h:180
double MaxX
Definition: librtcore.h:178
tuple rast
Definition: rtpixdump.py:61
void cu_free_raster(rt_raster raster)
uint16_t rt_raster_get_width(rt_raster raster)
Definition: rt_raster.c:121
double MinX
Definition: librtcore.h:177
rt_raster rt_raster_compute_skewed_raster(rt_envelope extent, double *skew, double *scale, double tolerance)
Definition: rt_raster.c:960
uint16_t rt_raster_get_height(rt_raster raster)
Definition: rt_raster.c:129
double UpperLeftY
Definition: librtcore.h:183
double rt_raster_get_y_offset(rt_raster raster)
Get raster y offset, in projection units.
Definition: rt_raster.c:222

Here is the call graph for this function:

Here is the caller graph for this function: