918 GISTENTRY *entry_in = (GISTENTRY*)PG_GETARG_POINTER(0);
919 GISTENTRY *entry_out = NULL;
923 POSTGIS_DEBUG(4,
"[GIST] 'compress' function called");
929 if ( ! entry_in->leafkey )
931 POSTGIS_DEBUG(4,
"[GIST] non-leafkey entry, returning input unaltered");
932 PG_RETURN_POINTER(entry_in);
935 POSTGIS_DEBUG(4,
"[GIST] processing leafkey input");
936 entry_out = palloc(
sizeof(GISTENTRY));
942 if ( DatumGetPointer(entry_in->key) == NULL )
944 POSTGIS_DEBUG(4,
"[GIST] leafkey is null");
945 gistentryinit(*entry_out, (Datum) 0, entry_in->rel,
946 entry_in->page, entry_in->offset,
FALSE);
947 POSTGIS_DEBUG(4,
"[GIST] returning copy of input");
948 PG_RETURN_POINTER(entry_out);
957 POSTGIS_DEBUG(4,
"[GIST] empty geometry!");
958 PG_RETURN_POINTER(entry_in);
961 POSTGIS_DEBUGF(4,
"[GIST] got entry_in->key: %s",
box2df_to_string(&bbox_out));
964 if ( ! isfinite(bbox_out.xmax) || ! isfinite(bbox_out.xmin) ||
965 ! isfinite(bbox_out.ymax) || ! isfinite(bbox_out.ymin) )
967 POSTGIS_DEBUG(4,
"[GIST] infinite geometry!");
968 PG_RETURN_POINTER(entry_in);
975 gistentryinit(*entry_out, PointerGetDatum(
box2df_copy(&bbox_out)),
976 entry_in->rel, entry_in->page, entry_in->offset,
FALSE);
979 POSTGIS_DEBUG(4,
"[GIST] 'compress' function complete");
980 PG_RETURN_POINTER(entry_out);
static void box2df_validate(BOX2DF *b)
static BOX2DF * box2df_copy(BOX2DF *b)
static char * box2df_to_string(const BOX2DF *a)
int gserialized_datum_get_box2df_p(Datum gsdatum, BOX2DF *box2df)
Peak into a GSERIALIZED datum to find the bounding box.