They make spatial indexes inspectable with Gevel:
http://www.sai.msu.su/~megera/wiki/Gevel
git-svn-id: http://svn.osgeo.org/postgis/trunk@13297
b70326c6-7e19-0410-871a-
916f4a2858ee
* New Features *
+ - Canonical output for index key types
- ST_SwapOrdinates (Sandro Santilli / Boundless)
- #3040, KNN GiST index based centroid (<<->>) and box (<<#>>)
n-D distance operators (Sandro Santilli / Boundless)
/* Generate human readable form for GIDX. */
-#if POSTGIS_DEBUG_LEVEL > 0
char* gidx_to_string(GIDX *a)
{
char *str, *rv;
if ( a == NULL )
return pstrdup("<NULLPTR>");
- str = (char*)palloc(128);
+ str = (char*)palloc(128); /* 15*2*4+8==128 */
rv = str;
ndims = GIDX_NDIMS(a);
return rv;
}
-#endif
static uint8_t
/* Generate human readable form for GIDX. */
-#if POSTGIS_DEBUG_LEVEL > 0
char* gidx_to_string(GIDX *a) ;
-#endif
/* typedef to correct array-bounds checking for casts to GIDX - do not
use this ANYWHERE except in the casts below */
typedef bool (*box2df_predicate)(const BOX2DF *a, const BOX2DF *b);
-#if POSTGIS_DEBUG_LEVEL > 0
static char* box2df_to_string(const BOX2DF *a)
{
char *rv = NULL;
sprintf(rv, "BOX2DF(%.12g %.12g, %.12g %.12g)", a->xmin, a->ymin, a->xmax, a->ymax);
return rv;
}
-#endif
-
/* Allocate a new copy of BOX2DF */
static BOX2DF* box2df_copy(BOX2DF *b)
PG_FUNCTION_INFO_V1(box2df_out);
Datum box2df_out(PG_FUNCTION_ARGS)
{
- ereport(ERROR,(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("function box2df_out not implemented")));
- PG_RETURN_POINTER(NULL);
+ BOX2DF *box = (BOX2DF *) PG_GETARG_POINTER(0);
+ char *result = box2df_to_string(box);
+ PG_RETURN_CSTRING(result);
}
PG_FUNCTION_INFO_V1(gidx_out);
Datum gidx_out(PG_FUNCTION_ARGS)
{
- ereport(ERROR,(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("function gidx_out not implemented")));
- PG_RETURN_POINTER(NULL);
+ GIDX *box = (GIDX *) PG_GETARG_POINTER(0);
+ char *result = gidx_to_string(box);
+ PG_RETURN_CSTRING(result);
}