PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ RASTER_fromWKB()

Datum RASTER_fromWKB ( PG_FUNCTION_ARGS  )

Definition at line 143 of file rtpg_wkb.c.

144 {
145  bytea *bytea_data;
146  uint8_t *data;
147  int data_len = 0;
148 
150  void *result = NULL;
151 
152  POSTGIS_RT_DEBUG(3, "Starting");
153 
154  bytea_data = (bytea *) PG_GETARG_BYTEA_P(0);
155  data = (uint8_t *) VARDATA(bytea_data);
156  data_len = VARSIZE(bytea_data) - VARHDRSZ;
157 
158  raster = rt_raster_from_wkb(data, data_len);
159  PG_FREE_IF_COPY(bytea_data, 0);
160  if (raster == NULL)
161  PG_RETURN_NULL();
162 
163  result = rt_raster_serialize(raster);
165  if (result == NULL)
166  PG_RETURN_NULL();
167 
168  SET_VARSIZE(result, ((rt_pgraster*)result)->size);
169  PG_RETURN_POINTER(result);
170 }
rt_raster rt_raster_from_wkb(const uint8_t *wkb, uint32_t wkbsize)
Construct an rt_raster from a binary WKB representation.
Definition: rt_wkb.c:276
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
data
Definition: ovdump.py:103
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rtpostgis.h:61
Struct definitions.
Definition: librtcore.h:2250
unsigned char uint8_t
Definition: uthash.h:79

References ovdump::data, POSTGIS_RT_DEBUG, rtrowdump::raster, rt_raster_destroy(), rt_raster_from_wkb(), and rt_raster_serialize().

Here is the call graph for this function: