PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ RASTER_noop()

Datum RASTER_noop ( PG_FUNCTION_ARGS  )

Definition at line 174 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_bytea().

175 {
177  rt_pgraster *pgraster, *result;
178  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
179  raster = rt_raster_deserialize(pgraster, FALSE);
180  if (!raster) {
181  PG_FREE_IF_COPY(pgraster, 0);
182  elog(ERROR, "RASTER_noop: Cannot deserialize raster");
183  PG_RETURN_NULL();
184  }
185  result = rt_raster_serialize(raster);
186  rt_raster_destroy(raster);
187  if (result == NULL)
188  PG_RETURN_NULL();
189 
190  SET_VARSIZE(result, raster->size);
191  PG_RETURN_POINTER(result);
192 }
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:2285
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:2250
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_serialize.c:725
Here is the call graph for this function:
Here is the caller graph for this function: