53 elog(ERROR,
"RASTER_to_binary: This function is out of date. Run ALTER EXTENSION postgis UPDATE; to fix");
65 char *hexwkb = PG_GETARG_CSTRING(0);
80 PG_RETURN_POINTER(result);
97 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
98 pgraster = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
102 PG_FREE_IF_COPY(pgraster, 0);
103 elog(ERROR,
"RASTER_out: Cannot deserialize raster");
110 PG_FREE_IF_COPY(pgraster, 0);
111 elog(ERROR,
"RASTER_out: Cannot HEX-WKBize raster");
117 PG_FREE_IF_COPY(pgraster, 0);
119 PG_RETURN_CSTRING(hexwkb);
133 bytea *result = NULL;
136 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
137 pgraster = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
142 PG_FREE_IF_COPY(pgraster, 0);
143 elog(ERROR,
"RASTER_to_bytea: Cannot deserialize raster");
151 PG_FREE_IF_COPY(pgraster, 0);
152 elog(ERROR,
"RASTER_to_bytea: Cannot allocate and generate WKB data");
157 result_size = wkb_size + VARHDRSZ;
158 result = (bytea *)palloc(result_size);
159 SET_VARSIZE(result, result_size);
160 memcpy(VARDATA(result), wkb, VARSIZE(result) - VARHDRSZ);
165 PG_FREE_IF_COPY(pgraster, 0);
167 PG_RETURN_POINTER(result);
178 pgraster = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
181 PG_FREE_IF_COPY(pgraster, 0);
182 elog(ERROR,
"RASTER_noop: Cannot deserialize raster");
190 SET_VARSIZE(result,
raster->size);
191 PG_RETURN_POINTER(result);
char * rt_raster_to_hexwkb(rt_raster raster, int outasin, uint32_t *hexwkbsize)
Return this raster in HEXWKB form (null-terminated hex)
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
uint8_t * rt_raster_to_wkb(rt_raster raster, int outasin, uint32_t *wkbsize)
Return this raster in WKB form.
rt_raster rt_raster_from_hexwkb(const char *hexwkb, uint32_t hexwkbsize)
Construct an rt_raster from a text HEXWKB representation.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
Datum RASTER_to_bytea(PG_FUNCTION_ARGS)
Datum RASTER_to_binary(PG_FUNCTION_ARGS)
obsolete as of 2.5.0 stubbing for smoother upgrade from 2.4
PG_FUNCTION_INFO_V1(RASTER_to_binary)
Legacy return error if called Removed in PostGIS 2.5.0.
Datum RASTER_out(PG_FUNCTION_ARGS)
Datum RASTER_in(PG_FUNCTION_ARGS)
Datum RASTER_noop(PG_FUNCTION_ARGS)
#define POSTGIS_RT_DEBUG(level, msg)