PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ RASTER_fromHexWKB()

Datum RASTER_fromHexWKB ( PG_FUNCTION_ARGS  )

Definition at line 176 of file rtpg_wkb.c.

177 {
178  text *hexwkb_text = PG_GETARG_TEXT_P(0);
179  char *hexwkb;
180 
182  void *result = NULL;
183 
184  POSTGIS_RT_DEBUG(3, "Starting");
185 
186  hexwkb = text_to_cstring(hexwkb_text);
187 
188  raster = rt_raster_from_hexwkb(hexwkb, strlen(hexwkb));
189  PG_FREE_IF_COPY(hexwkb_text, 0);
190  if (raster == NULL)
191  PG_RETURN_NULL();
192 
193  result = rt_raster_serialize(raster);
195  if (result == NULL)
196  PG_RETURN_NULL();
197 
198  SET_VARSIZE(result, ((rt_pgraster*)result)->size);
199  PG_RETURN_POINTER(result);
200 }
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_serialize.c:521
rt_raster rt_raster_from_hexwkb(const char *hexwkb, uint32_t hexwkbsize)
Construct an rt_raster from a text HEXWKB representation.
Definition: rt_wkb.c:406
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
char * text_to_cstring(const text *textptr)
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rtpostgis.h:61
Struct definitions.
Definition: librtcore.h:2250

References POSTGIS_RT_DEBUG, rtrowdump::raster, rt_raster_destroy(), rt_raster_from_hexwkb(), rt_raster_serialize(), and text_to_cstring().

Here is the call graph for this function: