PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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_ANY_EXHDR(bytea_data);
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);
164 rt_raster_destroy(raster);
165 if (result == NULL)
166 PG_RETURN_NULL();
167
168 SET_VARSIZE(result, ((rt_pgraster*)result)->size);
169 PG_RETURN_POINTER(result);
170}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
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:283
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition rt_raster.c:86
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition rtrowdump.py:125
#define POSTGIS_RT_DEBUG(level, msg)
Definition rtpostgis.h:65
Struct definitions.
Definition librtcore.h:2452

References POSTGIS_RT_DEBUG, result, rt_raster_destroy(), rt_raster_from_wkb(), and rt_raster_serialize().

Here is the call graph for this function: