PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ RASTER_in()

Datum RASTER_in ( PG_FUNCTION_ARGS  )

Definition at line 62 of file rtpg_inout.c.

References PG_FUNCTION_INFO_V1(), POSTGIS_RT_DEBUG, rtrowdump::raster, RASTER_out(), rt_raster_destroy(), rt_raster_from_hexwkb(), rt_raster_serialize(), and rt_raster_serialized_t::size.

Referenced by RASTER_to_binary().

63 {
65  char *hexwkb = PG_GETARG_CSTRING(0);
66  void *result = NULL;
67 
68  POSTGIS_RT_DEBUG(3, "Starting");
69 
70  raster = rt_raster_from_hexwkb(hexwkb, strlen(hexwkb));
71  if (raster == NULL)
72  PG_RETURN_NULL();
73 
74  result = rt_raster_serialize(raster);
75  rt_raster_destroy(raster);
76  if (result == NULL)
77  PG_RETURN_NULL();
78 
79  SET_VARSIZE(result, ((rt_pgraster*)result)->size);
80  PG_RETURN_POINTER(result);
81 }
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_serialize.c:521
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Definition: rtrowdump.py:121
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
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
Struct definitions.
Definition: librtcore.h:2250
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rtpostgis.h:61
Here is the call graph for this function:
Here is the caller graph for this function: