PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ RASTER_setSkew()

Datum RASTER_setSkew ( PG_FUNCTION_ARGS  )

Definition at line 983 of file rtpg_raster_properties.c.

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

Referenced by RASTER_setScaleXY().

984 {
985  rt_pgraster *pgraster = NULL;
986  rt_pgraster *pgrtn = NULL;
988  double skew = PG_GETARG_FLOAT8(1);
989 
990  if (PG_ARGISNULL(0))
991  PG_RETURN_NULL();
992  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
993  raster = rt_raster_deserialize(pgraster, FALSE);
994  if (!raster) {
995  PG_FREE_IF_COPY(pgraster, 0);
996  elog(ERROR, "RASTER_setSkew: Could not deserialize raster");
997  PG_RETURN_NULL();
998  }
999 
1000  rt_raster_set_skews(raster, skew, skew);
1001 
1002  pgrtn = rt_raster_serialize(raster);
1003  rt_raster_destroy(raster);
1004  PG_FREE_IF_COPY(pgraster, 0);
1005  if (!pgrtn)
1006  PG_RETURN_NULL();
1007 
1008  SET_VARSIZE(pgrtn, pgrtn->size);
1009  PG_RETURN_POINTER(pgrtn);
1010 }
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_serialize.c:521
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_skews(rt_raster raster, double skewX, double skewY)
Set skews about the X and Y axis.
Definition: rt_raster.c:168
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
#define FALSE
Definition: dbfopen.c:168
Struct definitions.
Definition: librtcore.h:2230
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_serialize.c:717
Here is the call graph for this function:
Here is the caller graph for this function: