PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/spgist.h"
#include "access/spgist_private.h"
#include "access/stratnum.h"
#include "catalog/pg_type.h"
#include "utils/float.h"
#include "utils/fmgrprotos.h"
#include "utils/geo_decls.h"
Go to the source code of this file.
Macros | |
#define | SPTEST(f, x, y) DatumGetBool(DirectFunctionCall2(f, PointPGetDatum(x), PointPGetDatum(y))) |
Functions | |
Datum | spg_quad_config (PG_FUNCTION_ARGS) |
static int16 | getQuadrant (Point *centroid, Point *tst) |
static BOX * | getQuadrantArea (BOX *bbox, Point *centroid, int quadrant) |
Datum | spg_quad_choose (PG_FUNCTION_ARGS) |
Datum | spg_quad_picksplit (PG_FUNCTION_ARGS) |
Datum | spg_quad_inner_consistent (PG_FUNCTION_ARGS) |
Datum | spg_quad_leaf_consistent (PG_FUNCTION_ARGS) |
#define SPTEST | ( | f, | |
x, | |||
y | |||
) | DatumGetBool(DirectFunctionCall2(f, PointPGetDatum(x), PointPGetDatum(y))) |
Definition at line 39 of file spgquadtreeproc.c.
Definition at line 55 of file spgquadtreeproc.c.
References elog, ERROR, point_above(), point_below(), point_horiz(), point_left(), point_right(), point_vert(), and SPTEST.
Referenced by spg_quad_choose(), spg_quad_inner_consistent(), and spg_quad_picksplit().
Definition at line 83 of file spgquadtreeproc.c.
References BOX::high, BOX::low, palloc(), Point::x, and Point::y.
Referenced by spg_quad_inner_consistent().
Datum spg_quad_choose | ( | PG_FUNCTION_ARGS | ) |
Definition at line 115 of file spgquadtreeproc.c.
References spgChooseIn::allTheSame, Assert, spgChooseIn::datum, DatumGetPointP(), getQuadrant(), spgChooseIn::hasPrefix, spgChooseOut::levelAdd, spgChooseOut::matchNode, spgChooseIn::nNodes, spgChooseOut::nodeN, PG_GETARG_POINTER, PG_RETURN_VOID, PointPGetDatum(), spgChooseIn::prefixDatum, spgChooseOut::restDatum, spgChooseOut::result, spgChooseOut::resultType, and spgMatchNode.
Datum spg_quad_config | ( | PG_FUNCTION_ARGS | ) |
Definition at line 27 of file spgquadtreeproc.c.
References spgConfigOut::canReturnData, spgConfigOut::labelType, spgConfigOut::longValuesOK, PG_GETARG_POINTER, PG_RETURN_VOID, and spgConfigOut::prefixType.
Datum spg_quad_inner_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 227 of file spgquadtreeproc.c.
References spgInnerConsistentIn::allTheSame, Assert, box_contain_pt(), box_copy(), BoxPGetDatum(), DatumGetBool(), DatumGetBoxP(), DatumGetPointP(), DirectFunctionCall2, spgInnerConsistentOut::distances, elog, ERROR, get_float8_infinity(), getQuadrant(), getQuadrantArea(), spgInnerConsistentIn::hasPrefix, BOX::high, i, spgInnerConsistentIn::level, spgInnerConsistentOut::levelAdds, BOX::low, MemoryContextSwitchTo(), spgInnerConsistentIn::nkeys, spgInnerConsistentIn::nNodes, spgInnerConsistentOut::nNodes, spgInnerConsistentOut::nodeNumbers, spgInnerConsistentIn::norderbys, spgInnerConsistentIn::orderbys, palloc(), PG_GETARG_POINTER, PG_RETURN_VOID, point_above(), point_below(), point_left(), point_right(), PointerGetDatum(), spgInnerConsistentIn::prefixDatum, RTAboveStrategyNumber, RTBelowStrategyNumber, RTContainedByStrategyNumber, RTLeftStrategyNumber, RTOldAboveStrategyNumber, RTOldBelowStrategyNumber, RTRightStrategyNumber, RTSameStrategyNumber, spgInnerConsistentIn::scankeys, ScanKeyData::sk_argument, ScanKeyData::sk_strategy, spg_key_orderbys_distances(), SPTEST, spgInnerConsistentIn::traversalMemoryContext, spgInnerConsistentIn::traversalValue, spgInnerConsistentOut::traversalValues, Point::x, and Point::y.
Datum spg_quad_leaf_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 407 of file spgquadtreeproc.c.
References box_contain_pt(), DatumGetPointP(), spgLeafConsistentOut::distances, elog, ERROR, i, spgLeafConsistentIn::leafDatum, spgLeafConsistentOut::leafValue, spgLeafConsistentIn::nkeys, spgLeafConsistentIn::norderbys, spgLeafConsistentIn::orderbys, PG_GETARG_POINTER, PG_RETURN_BOOL, point_above(), point_below(), point_eq(), point_left(), point_right(), spgLeafConsistentOut::recheck, res, RTAboveStrategyNumber, RTBelowStrategyNumber, RTContainedByStrategyNumber, RTLeftStrategyNumber, RTOldAboveStrategyNumber, RTOldBelowStrategyNumber, RTRightStrategyNumber, RTSameStrategyNumber, spgLeafConsistentIn::scankeys, ScanKeyData::sk_argument, ScanKeyData::sk_strategy, spg_key_orderbys_distances(), and SPTEST.
Datum spg_quad_picksplit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 169 of file spgquadtreeproc.c.
References DatumGetPointP(), spgPickSplitIn::datums, getQuadrant(), spgPickSplitOut::hasPrefix, i, spgPickSplitOut::leafTupleDatums, spgPickSplitOut::mapTuplesToNodes, spgPickSplitOut::nNodes, spgPickSplitOut::nodeLabels, spgPickSplitIn::nTuples, palloc(), palloc0(), PG_GETARG_POINTER, PG_RETURN_VOID, PointPGetDatum(), spgPickSplitOut::prefixDatum, qsort, Point::x, x_cmp(), Point::y, and y_cmp().