30 #include "access/hash.h"
31 #include "utils/geo_decls.h"
32 #include "utils/sortsupport.h"
34 #include "../postgis_config.h"
36 #include "lwgeom_pg.h"
57 PG_FREE_IF_COPY(g1, 0);
58 PG_FREE_IF_COPY(g2, 1);
59 PG_RETURN_BOOL(cmp < 0);
68 PG_FREE_IF_COPY(g1, 0);
69 PG_FREE_IF_COPY(g2, 1);
70 PG_RETURN_BOOL(cmp <= 0);
79 PG_FREE_IF_COPY(g1, 0);
80 PG_FREE_IF_COPY(g2, 1);
81 PG_RETURN_BOOL(cmp == 0);
90 PG_FREE_IF_COPY(g1, 0);
91 PG_FREE_IF_COPY(g2, 1);
92 PG_RETURN_BOOL(cmp != 0);
101 PG_FREE_IF_COPY(g1, 0);
102 PG_FREE_IF_COPY(g2, 1);
103 PG_RETURN_BOOL(cmp >= 0);
112 PG_FREE_IF_COPY(g1, 0);
113 PG_FREE_IF_COPY(g2, 1);
114 PG_RETURN_BOOL(cmp > 0);
123 PG_FREE_IF_COPY(g1, 0);
124 PG_FREE_IF_COPY(g2, 1);
125 PG_RETURN_INT32(ret);
134 PG_FREE_IF_COPY(g1, 0);
135 PG_RETURN_INT32(hval);
142 if (
x == 0 ||
y == 0 ||
x ==
y)
182 SortSupport ssup = (SortSupport)PG_GETARG_POINTER(0);
185 ssup->ssup_extra = NULL;
187 if (ssup->abbreviate &&
sizeof(Datum) == 8)
uint64_t gserialized_get_sortable_hash(const GSERIALIZED *g)
Return a sortable key based on gserialized.
int32_t gserialized_hash(const GSERIALIZED *g)
Returns a hash code for the srid/type/geometry information in the GSERIALIZED.
int gserialized_cmp(const GSERIALIZED *g1, const GSERIALIZED *g2)
Return -1 if g1 is "less than" g2, 1 if g1 is "greater than" g2 and 0 if g1 and g2 are the "same".
This library is the generic geometry handling section of PostGIS.
Datum lwgeom_sortsupport(PG_FUNCTION_ARGS)
Datum lwgeom_lt(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(lwgeom_lt)
Datum lwgeom_cmp(PG_FUNCTION_ARGS)
Datum lwgeom_ge(PG_FUNCTION_ARGS)
Datum lwgeom_gt(PG_FUNCTION_ARGS)
Datum lwgeom_neq(PG_FUNCTION_ARGS)
static bool lwgeom_abbrev_abort(int memtupcount, SortSupport ssup)
static int lwgeom_cmp_abbrev(Datum x, Datum y, SortSupport ssup)
Datum lwgeom_eq(PG_FUNCTION_ARGS)
Datum lwgeom_le(PG_FUNCTION_ARGS)
static Datum lwgeom_abbrev_convert(Datum original, SortSupport ssup)
static int lwgeom_cmp_full(Datum x, Datum y, SortSupport ssup)
Datum lwgeom_hash(PG_FUNCTION_ARGS)
#define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori)