PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_raster_geopoint_to_cell()

static void test_raster_geopoint_to_cell ( )
static

Definition at line 46 of file cu_raster_misc.c.

References cu_free_raster(), ES_NONE, window::gt, rtrowdump::raster, rt_raster_geopoint_to_cell(), rt_raster_new(), rt_raster_set_geotransform_matrix(), and rt_raster_set_srid().

Referenced by raster_misc_suite_setup().

46  {
48  int rtn;
49  double xr, yr;
50  double gt[6] = {-128.604911499087763, 0.002424431085498, 0, 53.626968388905752, 0, -0.002424431085498};
51 
52  raster = rt_raster_new(1, 1);
53  CU_ASSERT(raster != NULL); /* or we're out of virtual memory */
54  rt_raster_set_srid(raster, 4326);
56 
57  rtn = rt_raster_geopoint_to_cell(raster, gt[0], gt[3], &xr, &yr, NULL);
58  CU_ASSERT_EQUAL(rtn, ES_NONE);
59  CU_ASSERT_DOUBLE_EQUAL(xr, 0, DBL_EPSILON);
60  CU_ASSERT_DOUBLE_EQUAL(yr, 0, DBL_EPSILON);
61 
62  cu_free_raster(raster);
63 }
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
void rt_raster_set_geotransform_matrix(rt_raster raster, double *gt)
Set raster's geotransform using 6-element array.
Definition: rt_raster.c:727
gt
Definition: window.py:77
void cu_free_raster(rt_raster raster)
void rt_raster_set_srid(rt_raster raster, int32_t srid)
Set raster's SRID.
Definition: rt_raster.c:363
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.
Definition: rt_raster.c:806
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
Definition: rt_raster.c:48
Here is the call graph for this function:
Here is the caller graph for this function: