PostGIS  2.2.7dev-r@@SVN_REVISION@@
gserialized_gist_nd.c File Reference
#include "postgres.h"
#include "access/gist.h"
#include "access/itup.h"
#include "access/skey.h"
#include "../postgis_config.h"
#include "liblwgeom.h"
#include "lwgeom_pg.h"
#include "gserialized_gist.h"
#include "geography.h"
#include <assert.h>
Include dependency graph for gserialized_gist_nd.c:

Go to the source code of this file.


#define LIMIT_RATIO   0.1
#define BELOW(d)   (2*(d))
#define ABOVE(d)   ((2*(d))+1)


typedef bool(* gidx_predicate) (GIDX *a, GIDX *b)


Datum gidx_out (PG_FUNCTION_ARGS)
Datum gidx_in (PG_FUNCTION_ARGS)
Datum gserialized_gist_consistent (PG_FUNCTION_ARGS)
Datum gserialized_gist_compress (PG_FUNCTION_ARGS)
Datum gserialized_gist_decompress (PG_FUNCTION_ARGS)
Datum gserialized_gist_penalty (PG_FUNCTION_ARGS)
Datum gserialized_gist_picksplit (PG_FUNCTION_ARGS)
Datum gserialized_gist_union (PG_FUNCTION_ARGS)
Datum gserialized_gist_same (PG_FUNCTION_ARGS)
Datum gserialized_gist_distance (PG_FUNCTION_ARGS)
Datum gserialized_gist_geog_distance (PG_FUNCTION_ARGS)
Datum gserialized_overlaps (PG_FUNCTION_ARGS)
Datum gserialized_contains (PG_FUNCTION_ARGS)
Datum gserialized_within (PG_FUNCTION_ARGS)
Datum gserialized_distance_nd (PG_FUNCTION_ARGS)
static GIDX * gidx_copy (GIDX *b)
static void gidx_validate (GIDX *b)
static bool gidx_is_unknown (const GIDX *a)
static void gidx_set_unknown (GIDX *a)
static void gidx_merge (GIDX **b_union, GIDX *b_new)
static float gidx_volume (GIDX *a)
static void gidx_dimensionality_check (GIDX **a, GIDX **b)
static float gidx_union_volume (GIDX *a, GIDX *b)
static float gidx_inter_volume (GIDX *a, GIDX *b)
static bool gidx_overlaps (GIDX *a, GIDX *b)
static bool gidx_contains (GIDX *a, GIDX *b)
static bool gidx_equals (GIDX *a, GIDX *b)
static int gserialized_datum_predicate (Datum gs1, Datum gs2, gidx_predicate predicate)
 Support function. More...
static double gidx_distance_leaf_centroid (const GIDX *a, const GIDX *b)
 Calculate the centroid->centroid distance between the boxes. More...
static double gidx_distance (const GIDX *a, const GIDX *b, int m_is_time)
 Calculate the box->box distance. More...
static double gidx_distance_node_centroid (const GIDX *node, const GIDX *query)
GSERIALIZEDgserialized_expand (GSERIALIZED *g, double distance)
 Return a GSERIALIZED with an expanded bounding box. More...
 PG_FUNCTION_INFO_V1 (gserialized_distance_nd)
 PG_FUNCTION_INFO_V1 (gserialized_within)
 PG_FUNCTION_INFO_V1 (gserialized_contains)
 PG_FUNCTION_INFO_V1 (gserialized_overlaps)
 PG_FUNCTION_INFO_V1 (gserialized_gist_compress)
 PG_FUNCTION_INFO_V1 (gserialized_gist_decompress)
static bool gserialized_gist_consistent_leaf (GIDX *key, GIDX *query, StrategyNumber strategy)
static bool gserialized_gist_consistent_internal (GIDX *key, GIDX *query, StrategyNumber strategy)
 PG_FUNCTION_INFO_V1 (gserialized_gist_consistent)
 PG_FUNCTION_INFO_V1 (gserialized_gist_penalty)
 PG_FUNCTION_INFO_V1 (gserialized_gist_union)
 PG_FUNCTION_INFO_V1 (gserialized_gist_same)
 PG_FUNCTION_INFO_V1 (gserialized_gist_geog_distance)
 PG_FUNCTION_INFO_V1 (gserialized_gist_distance)
static void gserialized_gist_picksplit_addlist (OffsetNumber *list, GIDX **box_union, GIDX *box_current, int *pos, int num)
static int gserialized_gist_picksplit_badratio (int x, int y)
static bool gserialized_gist_picksplit_badratios (int *pos, int dims)
static void gserialized_gist_picksplit_fallback (GistEntryVector *entryvec, GIST_SPLITVEC *v)
static void gserialized_gist_picksplit_constructsplit (GIST_SPLITVEC *v, OffsetNumber *list1, int nlist1, GIDX **union1, OffsetNumber *list2, int nlist2, GIDX **union2)
 PG_FUNCTION_INFO_V1 (gserialized_gist_picksplit)
 PG_FUNCTION_INFO_V1 (gidx_in)
 PG_FUNCTION_INFO_V1 (gidx_out)