PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ RASTER_noop()

Datum RASTER_noop ( PG_FUNCTION_ARGS  )

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

160 {
162  rt_pgraster *pgraster, *result;
163  pgraster = (rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
164  raster = rt_raster_deserialize(pgraster, FALSE);
165  if (!raster) {
166  PG_FREE_IF_COPY(pgraster, 0);
167  elog(ERROR, "RASTER_noop: Cannot deserialize raster");
168  PG_RETURN_NULL();
169  }
170  result = rt_raster_serialize(raster);
171  rt_raster_destroy(raster);
172  if (result == NULL)
173  PG_RETURN_NULL();
174 
175  SET_VARSIZE(result, raster->size);
176  PG_RETURN_POINTER(result);
177 }
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: