PostGIS  2.1.10dev-r@@SVN_REVISION@@
Datum RASTER_setSkew ( PG_FUNCTION_ARGS  )

Definition at line 1896 of file rt_pg.c.

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

1897 {
1898  rt_pgraster *pgraster = NULL;
1899  rt_pgraster *pgrtn = NULL;
1900  rt_raster raster;
1901  double skew = PG_GETARG_FLOAT8(1);
1902 
1903  if (PG_ARGISNULL(0))
1904  PG_RETURN_NULL();
1905  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
1906  raster = rt_raster_deserialize(pgraster, FALSE);
1907  if (!raster) {
1908  PG_FREE_IF_COPY(pgraster, 0);
1909  elog(ERROR, "RASTER_setSkew: Could not deserialize raster");
1910  PG_RETURN_NULL();
1911  }
1912 
1913  rt_raster_set_skews(raster, skew, skew);
1914 
1915  pgrtn = rt_raster_serialize(raster);
1916  rt_raster_destroy(raster);
1917  PG_FREE_IF_COPY(pgraster, 0);
1918  if (!pgrtn)
1919  PG_RETURN_NULL();
1920 
1921  SET_VARSIZE(pgrtn, pgrtn->size);
1922  PG_RETURN_POINTER(pgrtn);
1923 }
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_api.c:8158
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_api.c:5387
tuple raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:123
void rt_raster_set_skews(rt_raster raster, double skewX, double skewY)
Set skews about the X and Y axis.
Definition: rt_api.c:5473
#define FALSE
Definition: dbfopen.c:169
Struct definitions.
Definition: rt_api.h:2175
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_api.c:8350

Here is the call graph for this function: