32 #include <utils/builtins.h>
34 #include "../../postgis_config.h"
35 #include "lwgeom_pg.h"
37 #define xstr(s) str(s)
56 result = cstring_to_text(ver);
57 PG_RETURN_TEXT_P(result);
63 char *ver = POSTGIS_BUILD_DATE;
65 result = palloc(VARHDRSZ + strlen(ver));
66 SET_VARSIZE(result, VARHDRSZ + strlen(ver));
67 memcpy(VARDATA(result), ver, strlen(ver));
68 PG_RETURN_POINTER(result);
80 size_t sz = strlen(ver) + strlen(
" GDAL_DATA not found") + 1;
83 result = cstring_to_text(ver);
85 snprintf(rtn, sz,
"%s GDAL_DATA not found", ver);
86 result = cstring_to_text(rtn);
91 result = cstring_to_text(ver);
93 PG_RETURN_POINTER(result);
99 text *pixeltypetext = NULL;
100 char *pixeltypechar = NULL;
107 pixeltypetext = PG_GETARG_TEXT_P(0);
112 elog(ERROR,
"RASTER_minPossibleValue: Invalid pixel type: %s", pixeltypechar);
136 PG_RETURN_FLOAT8(pixsize);
144 void *detoasted = PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
145 size_t size = VARSIZE(detoasted);
146 PG_FREE_IF_COPY(detoasted,0);
147 PG_RETURN_INT32(size);
int rt_util_gdal_configured(void)
rt_pixtype rt_pixtype_index_from_name(const char *pixname)
const char * rt_util_gdal_version(const char *request)
double rt_pixtype_get_min_value(rt_pixtype pixtype)
Return minimum value possible for pixel type.
char * text_to_cstring(const text *textptr)
Datum RASTER_lib_version(PG_FUNCTION_ARGS)
Datum RASTER_lib_build_date(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(RASTER_lib_version)
Datum RASTER_minPossibleValue(PG_FUNCTION_ARGS)
Datum RASTER_gdal_version(PG_FUNCTION_ARGS)
Datum RASTER_memsize(PG_FUNCTION_ARGS)
find the detoasted size of a value
#define POSTGIS_LIB_VERSION