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

Definition at line 6699 of file rt_pg.c.

References FALSE, rtrowdump::raster, rt_raster_deserialize(), rt_raster_destroy(), rt_raster_is_empty(), and TRUE.

6700 {
6701  rt_pgraster *pgraster = NULL;
6702  rt_raster raster = NULL;
6703  bool isempty = FALSE;
6704 
6705  /* Deserialize raster */
6706  if (PG_ARGISNULL(0)) PG_RETURN_NULL();
6707  pgraster = (rt_pgraster *) PG_DETOAST_DATUM_SLICE(PG_GETARG_DATUM(0), 0, sizeof(struct rt_raster_serialized_t));
6708 
6709  raster = rt_raster_deserialize(pgraster, TRUE);
6710  if ( ! raster )
6711  {
6712  ereport(ERROR,
6713  (errcode(ERRCODE_OUT_OF_MEMORY),
6714  errmsg("RASTER_isEmpty: Could not deserialize raster")));
6715  PG_FREE_IF_COPY(pgraster, 0);
6716  PG_RETURN_NULL();
6717  }
6718 
6719  isempty = rt_raster_is_empty(raster);
6720 
6721  rt_raster_destroy(raster);
6722  PG_FREE_IF_COPY(pgraster, 0);
6723 
6724  PG_RETURN_BOOL(isempty);
6725 }
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
#define FALSE
Definition: dbfopen.c:169
Struct definitions.
Definition: rt_api.h:2175
int rt_raster_is_empty(rt_raster raster)
Return TRUE if the raster is empty.
Definition: rt_api.c:8550
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Definition: rt_api.c:8350
#define TRUE
Definition: dbfopen.c:170

Here is the call graph for this function: