PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ rt_raster_set_phys_params()

void rt_raster_set_phys_params ( rt_raster  rast,
double  i_mag,
double  j_mag,
double  theta_i,
double  theta_ij 
)

Calculates the geotransform coefficients and applies them to the supplied raster.

The coefficients will not be applied if there was an error during the calculation.

This method affects only the scale and skew coefficients. The offset parameters are not changed.

Parameters
rastthe raster in which the geotransform will be stored.
i_magsize of a pixel along the transformed i axis
j_magsize of a pixel along the transformed j axis
theta_iangle by which the raster is rotated (radians positive clockwise)
theta_ijangle from transformed i axis to transformed j axis (radians positive counterclockwise)

Definition at line 297 of file rt_raster.c.

References return(), rt_raster_calc_gt_coeff(), rt_raster_set_scale(), and rt_raster_set_skews().

Referenced by RASTER_setGeotransform(), and RASTER_setRotation().

298 {
299  double o11, o12, o21, o22 ; /* calculated geotransform coefficients */
300  int success ;
301 
302  if (rast == NULL) return ;
303 
304  success = rt_raster_calc_gt_coeff(i_mag, j_mag, theta_i, theta_ij,
305  &o11, &o12, &o21, &o22) ;
306 
307  if (success) {
308  rt_raster_set_scale(rast, o11, o22) ;
309  rt_raster_set_skews(rast, o12, o21) ;
310  }
311 }
void rt_raster_set_scale(rt_raster raster, double scaleX, double scaleY)
Set scale in projection units.
Definition: rt_raster.c:137
void rt_raster_set_skews(rt_raster raster, double skewX, double skewY)
Set skews about the X and Y axis.
Definition: rt_raster.c:168
int rt_raster_calc_gt_coeff(double i_mag, double j_mag, double theta_i, double theta_ij, double *xscale, double *xskew, double *yskew, double *yscale)
Calculates the coefficients of a geotransform given the physically significant parameters describing ...
Definition: rt_raster.c:314
return(const char *)
Definition: dbfopen.c:1613
Here is the call graph for this function:
Here is the caller graph for this function: