PostGIS  2.1.10dev-r@@SVN_REVISION@@
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.

Parameters
raster: the raster to get info from
xr: the pixel's column
yr: the pixel's row
xw: output parameter, X ordinate of the geographical point
yw: output parameter, Y ordinate of the geographical point
gt: input/output parameter, 3x2 geotransform matrix
Returns
ES_NONE if success, ES_ERROR if error

Definition at line 6054 of file rt_api.c.

References ES_NONE, FLT_EQ, RASTER_DEBUGF, and rt_raster_get_geotransform_matrix().

Referenced by RASTER_rasterToWorldCoord(), RASTER_tile(), rt_raster_compute_skewed_raster(), rt_raster_from_two_rasters(), rt_raster_gdal_rasterize(), rt_raster_gdal_warp(), rt_raster_get_convex_hull(), rt_raster_get_envelope(), rt_raster_get_perimeter(), rt_raster_intersects(), rt_raster_intersects_algorithm(), rt_raster_same_alignment(), and test_raster_cell_to_geopoint().

6059  {
6060  double _gt[6] = {0};
6061 
6062  assert(NULL != raster);
6063  assert(NULL != xw && NULL != yw);
6064 
6065  if (NULL != gt)
6066  memcpy(_gt, gt, sizeof(double) * 6);
6067 
6068  /* scale of matrix is not set */
6069  if (
6070  FLT_EQ(_gt[1], 0) ||
6071  FLT_EQ(_gt[5], 0)
6072  ) {
6073  rt_raster_get_geotransform_matrix(raster, _gt);
6074  }
6075 
6076  RASTER_DEBUGF(4, "gt = (%f, %f, %f, %f, %f, %f)",
6077  _gt[0],
6078  _gt[1],
6079  _gt[2],
6080  _gt[3],
6081  _gt[4],
6082  _gt[5]
6083  );
6084 
6085  GDALApplyGeoTransform(_gt, xr, yr, xw, yw);
6086  RASTER_DEBUGF(4, "GDALApplyGeoTransform (c -> g) for (%f, %f) = (%f, %f)",
6087  xr, yr, *xw, *yw);
6088 
6089  return ES_NONE;
6090 }
tuple gt
Definition: window.py:79
void rt_raster_get_geotransform_matrix(rt_raster raster, double *gt)
Get 6-element array of raster geotransform matrix.
Definition: rt_api.c:6005
#define RASTER_DEBUGF(level, msg,...)
Definition: rt_api.h:285
#define FLT_EQ(x, y)
Definition: rt_api.h:2159

Here is the call graph for this function:

Here is the caller graph for this function: