PostGIS  2.4.9dev-r@@SVN_REVISION@@
gserialized_gist_2d.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 <float.h>
Include dependency graph for gserialized_gist_2d.c:

Go to the source code of this file.

Data Structures

struct  CommonEntry
 
struct  ConsiderSplitContext
 
struct  SplitInterval
 

Macros

#define LIMIT_RATIO   0.1
 
#define KOROTKOV_SPLIT   1
 
#define PLACE_LEFT(box, off)
 
#define PLACE_RIGHT(box, off)
 

Typedefs

typedef bool(* box2df_predicate) (const BOX2DF *a, const BOX2DF *b)
 

Functions

Datum box2df_out (PG_FUNCTION_ARGS)
 
Datum box2df_in (PG_FUNCTION_ARGS)
 
Datum gserialized_gist_consistent_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_gist_compress_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_gist_decompress_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_gist_penalty_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_gist_picksplit_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_gist_union_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_gist_same_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_gist_distance_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_same_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_within_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_contains_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_overlaps_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_left_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_right_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_above_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_below_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_overleft_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_overright_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_overabove_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_overbelow_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_distance_box_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_distance_centroid_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_contains_box2df_geom_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_contains_box2df_box2df_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_within_box2df_geom_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_within_box2df_box2df_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_overlaps_box2df_geom_2d (PG_FUNCTION_ARGS)
 
Datum gserialized_overlaps_box2df_box2df_2d (PG_FUNCTION_ARGS)
 
static char * box2df_to_string (const BOX2DF *a)
 
static BOX2DF * box2df_copy (BOX2DF *b)
 
static void box2df_merge (BOX2DF *b_union, BOX2DF *b_new)
 
static float box2df_size (const BOX2DF *a)
 
static float box2df_edge (const BOX2DF *a)
 
static float box2df_union_size (const BOX2DF *a, const BOX2DF *b)
 
static float box2df_union_edge (const BOX2DF *a, const BOX2DF *b)
 
static int box2df_from_gbox_p (GBOX *box, BOX2DF *a)
 
static void box2df_validate (BOX2DF *b)
 
static bool box2df_overlaps (const BOX2DF *a, const BOX2DF *b)
 
bool box2df_contains (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_within (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_equals (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_overleft (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_left (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_right (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_overright (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_overbelow (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_below (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_above (const BOX2DF *a, const BOX2DF *b)
 
static bool box2df_overabove (const BOX2DF *a, const BOX2DF *b)
 
static double box2df_distance_leaf_centroid (const BOX2DF *a, const BOX2DF *b)
 Calculate the centroid->centroid distance between the boxes. More...
 
static double pt_distance (double ax, double ay, double bx, double by)
 
static double box2df_distance (const BOX2DF *a, const BOX2DF *b)
 Calculate the box->box distance. More...
 
int gserialized_datum_get_box2df_p (Datum gsdatum, BOX2DF *box2df)
 Peak into a GSERIALIZED datum to find the bounding box. More...
 
static int gserialized_datum_predicate_2d (Datum gs1, Datum gs2, box2df_predicate predicate)
 Support function. More...
 
static int gserialized_datum_predicate_box2df_geom_2d (const BOX2DF *br1, Datum gs2, box2df_predicate predicate)
 
 PG_FUNCTION_INFO_V1 (gserialized_contains_box2df_geom_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_contains_box2df_box2df_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_within_box2df_geom_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_within_box2df_box2df_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_overlaps_box2df_geom_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_overlaps_box2df_box2df_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_distance_centroid_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_distance_box_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_same_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_within_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_contains_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_overlaps_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_left_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_right_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_above_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_below_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_overleft_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_overright_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_overabove_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_overbelow_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_gist_compress_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_gist_decompress_2d)
 
static bool gserialized_gist_consistent_leaf_2d (BOX2DF *key, BOX2DF *query, StrategyNumber strategy)
 
static bool gserialized_gist_consistent_internal_2d (BOX2DF *key, BOX2DF *query, StrategyNumber strategy)
 
 PG_FUNCTION_INFO_V1 (gserialized_gist_consistent_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_gist_distance_2d)
 
static float pack_float (const float value, const int realm)
 
 PG_FUNCTION_INFO_V1 (gserialized_gist_penalty_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_gist_union_2d)
 
 PG_FUNCTION_INFO_V1 (gserialized_gist_same_2d)
 
static void adjustBox (BOX2DF *b, BOX2DF *addon)
 
static void fallbackSplit (GistEntryVector *entryvec, GIST_SPLITVEC *v)
 
static int interval_cmp_lower (const void *i1, const void *i2)
 
static int interval_cmp_upper (const void *i1, const void *i2)
 
static float non_negative (float val)
 
static void g_box_consider_split (ConsiderSplitContext *context, int dimNum, float rightLower, int minLeftCount, float leftUpper, int maxLeftCount)
 
static float box_penalty (BOX2DF *original, BOX2DF *new)
 
static int common_entry_cmp (const void *i1, const void *i2)
 
 PG_FUNCTION_INFO_V1 (gserialized_gist_picksplit_2d)
 
 PG_FUNCTION_INFO_V1 (box2df_in)
 
 PG_FUNCTION_INFO_V1 (box2df_out)