PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ RASTER_in()

Datum RASTER_in ( PG_FUNCTION_ARGS  )

Definition at line 47 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.

48 {
50  char *hexwkb = PG_GETARG_CSTRING(0);
51  void *result = NULL;
52 
53  POSTGIS_RT_DEBUG(3, "Starting");
54 
55  raster = rt_raster_from_hexwkb(hexwkb, strlen(hexwkb));
56  if (raster == NULL)
57  PG_RETURN_NULL();
58 
59  result = rt_raster_serialize(raster);
60  rt_raster_destroy(raster);
61  if (result == NULL)
62  PG_RETURN_NULL();
63 
64  SET_VARSIZE(result, ((rt_pgraster*)result)->size);
65  PG_RETURN_POINTER(result);
66 }
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:2201
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rtpostgis.h:61
Here is the call graph for this function: