PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ RASTER_setSkewXY()

Datum RASTER_setSkewXY ( PG_FUNCTION_ARGS  )

Definition at line 1022 of file rtpg_raster_properties.c.

1023 {
1024  rt_pgraster *pgraster = NULL;
1025  rt_pgraster *pgrtn = NULL;
1026  rt_raster raster;
1027  double xskew = PG_GETARG_FLOAT8(1);
1028  double yskew = PG_GETARG_FLOAT8(2);
1029 
1030  if (PG_ARGISNULL(0))
1031  PG_RETURN_NULL();
1032  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
1033  raster = rt_raster_deserialize(pgraster, FALSE);
1034  if (!raster) {
1035  PG_FREE_IF_COPY(pgraster, 0);
1036  elog(ERROR, "RASTER_setSkewXY: Could not deserialize raster");
1037  PG_RETURN_NULL();
1038  }
1039 
1040  rt_raster_set_skews(raster, xskew, yskew);
1041 
1042  pgrtn = rt_raster_serialize(raster);
1044  PG_FREE_IF_COPY(pgraster, 0);
1045  if (!pgrtn)
1046  PG_RETURN_NULL();
1047 
1048  SET_VARSIZE(pgrtn, pgrtn->size);
1049  PG_RETURN_POINTER(pgrtn);
1050 }
#define FALSE
Definition: dbfopen.c:168
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
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
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_serialize.c:521
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_serialize.c:725
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
Struct definitions.
Definition: librtcore.h:2250

References FALSE, rtrowdump::raster, rt_raster_deserialize(), rt_raster_destroy(), rt_raster_serialize(), rt_raster_set_skews(), and rt_raster_serialized_t::size.

Here is the call graph for this function: