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

◆ 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);
194 rt_raster_destroy(raster);
195 if (result == NULL)
196 PG_RETURN_NULL();
197
198 SET_VARSIZE(result, ((rt_pgraster*)result)->size);
199 PG_RETURN_POINTER(result);
200}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition rt_raster.c:86
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:414
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_hexwkb(), and rt_raster_serialize().

Here is the call graph for this function: