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

Definition at line 1807 of file rt_pg.c.

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

1808 {
1809  rt_pgraster *pgraster = NULL;
1810  rt_pgraster *pgrtn = NULL;
1811  rt_raster raster;
1812  double xscale = PG_GETARG_FLOAT8(1);
1813  double yscale = PG_GETARG_FLOAT8(2);
1814 
1815  if (PG_ARGISNULL(0))
1816  PG_RETURN_NULL();
1817  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
1818  raster = rt_raster_deserialize(pgraster, FALSE);
1819  if (!raster) {
1820  PG_FREE_IF_COPY(pgraster, 0);
1821  elog(ERROR, "RASTER_setScaleXY: Could not deserialize raster");
1822  PG_RETURN_NULL();
1823  }
1824 
1825  rt_raster_set_scale(raster, xscale, yscale);
1826  pgrtn = rt_raster_serialize(raster);
1827  rt_raster_destroy(raster);
1828  PG_FREE_IF_COPY(pgraster, 0);
1829  if (!pgrtn)
1830  PG_RETURN_NULL();
1831 
1832  SET_VARSIZE(pgrtn, pgrtn->size);
1833  PG_RETURN_POINTER(pgrtn);
1834 }
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_scale(rt_raster raster, double scaleX, double scaleY)
Set scale in projection units.
Definition: rt_api.c:5442
#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: