30 #include "access/hash.h"
31 #include "utils/geo_decls.h"
33 #include "../postgis_config.h"
35 #include "lwgeom_pg.h"
56 PG_FREE_IF_COPY(g1, 0);
57 PG_FREE_IF_COPY(g2, 1);
61 PG_RETURN_BOOL(
false);
70 PG_FREE_IF_COPY(g1, 0);
71 PG_FREE_IF_COPY(g2, 1);
75 PG_RETURN_BOOL(
false);
84 PG_FREE_IF_COPY(g1, 0);
85 PG_FREE_IF_COPY(g2, 1);
89 PG_RETURN_BOOL(
false);
98 PG_FREE_IF_COPY(g1, 0);
99 PG_FREE_IF_COPY(g2, 1);
101 PG_RETURN_BOOL(
true);
103 PG_RETURN_BOOL(
false);
112 PG_FREE_IF_COPY(g1, 0);
113 PG_FREE_IF_COPY(g2, 1);
115 PG_RETURN_BOOL(
true);
117 PG_RETURN_BOOL(
false);
126 PG_FREE_IF_COPY(g1, 0);
127 PG_FREE_IF_COPY(g2, 1);
128 PG_RETURN_INT32(ret);
140 size_t sz1 = VARSIZE(g1);
141 size_t bsz1 = sz1 - hsz1;
144 size_t bsz2 = bsz1 +
sizeof(int);
147 memcpy(b2, &srid,
sizeof(
int));
149 memcpy(b2+
sizeof(
int), b1, bsz1);
151 hval = hash_any(b2, bsz2);
153 PG_FREE_IF_COPY(g1, 0);
154 PG_RETURN_DATUM(hval);
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
uint32_t gserialized_header_size(const GSERIALIZED *gser)
Returns the size in bytes of the header, from the start of the object up to the type number.
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_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_eq(PG_FUNCTION_ARGS)
Datum lwgeom_le(PG_FUNCTION_ARGS)
Datum lwgeom_hash(PG_FUNCTION_ARGS)