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

Definition at line 950 of file rtpg_raster_properties.c.

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

951 {
952  rt_pgraster *pgraster = NULL;
953  rt_pgraster *pgrtn = NULL;
955  double xscale = PG_GETARG_FLOAT8(1);
956  double yscale = PG_GETARG_FLOAT8(2);
957 
958  if (PG_ARGISNULL(0))
959  PG_RETURN_NULL();
960  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
961  raster = rt_raster_deserialize(pgraster, FALSE);
962  if (!raster) {
963  PG_FREE_IF_COPY(pgraster, 0);
964  elog(ERROR, "RASTER_setScaleXY: Could not deserialize raster");
965  PG_RETURN_NULL();
966  }
967 
968  rt_raster_set_scale(raster, xscale, yscale);
969  pgrtn = rt_raster_serialize(raster);
970  rt_raster_destroy(raster);
971  PG_FREE_IF_COPY(pgraster, 0);
972  if (!pgrtn)
973  PG_RETURN_NULL();
974 
975  SET_VARSIZE(pgrtn, pgrtn->size);
976  PG_RETURN_POINTER(pgrtn);
977 }
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_serialize.c:521
tuple 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_scale(rt_raster raster, double scaleX, double scaleY)
Set scale in projection units.
Definition: rt_raster.c:137
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:2213
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: