PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ RASTER_noop()

Datum RASTER_noop ( PG_FUNCTION_ARGS  )

Definition at line 205 of file rtpg_inout.c.

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

Referenced by RASTER_to_binary().

206 {
208  rt_pgraster *pgraster, *result;
209  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
210  raster = rt_raster_deserialize(pgraster, FALSE);
211  if (!raster) {
212  PG_FREE_IF_COPY(pgraster, 0);
213  elog(ERROR, "RASTER_noop: Could not deserialize raster");
214  PG_RETURN_NULL();
215  }
216  result = rt_raster_serialize(raster);
217  rt_raster_destroy(raster);
218  if (result == NULL)
219  PG_RETURN_NULL();
220 
221  SET_VARSIZE(result, raster->size);
222  PG_RETURN_POINTER(result);
223 }
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
uint32_t size
Definition: librtcore.h:2236
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:2201
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: