30 #include "utils/geo_decls.h" 32 #include "../postgis_config.h" 34 #include "lwgeom_pg.h" 58 POSTGIS_DEBUG(2,
"lwgeom_lt called");
62 POSTGIS_DEBUG(3,
"lwgeom_lt passed getSRID test");
67 PG_FREE_IF_COPY(geom1, 0);
68 PG_FREE_IF_COPY(geom2, 1);
70 POSTGIS_DEBUG(3,
"lwgeom_lt getbox2d_p passed");
72 if ( empty1 != empty2 )
74 PG_RETURN_BOOL(
FALSE);
101 PG_RETURN_BOOL(
FALSE);
113 POSTGIS_DEBUG(2,
"lwgeom_le called");
120 PG_FREE_IF_COPY(geom1, 0);
121 PG_FREE_IF_COPY(geom2, 1);
123 if ( empty1 != empty2 )
125 PG_RETURN_BOOL(
FALSE);
132 PG_RETURN_BOOL(
TRUE);
134 PG_RETURN_BOOL(
FALSE);
141 PG_RETURN_BOOL(
TRUE);
143 PG_RETURN_BOOL(
FALSE);
150 PG_RETURN_BOOL(
TRUE);
152 PG_RETURN_BOOL(
FALSE);
159 PG_RETURN_BOOL(
TRUE);
161 PG_RETURN_BOOL(
FALSE);
164 PG_RETURN_BOOL(
TRUE);
177 POSTGIS_DEBUG(2,
"lwgeom_eq called");
187 PG_FREE_IF_COPY(geom1, 0);
188 PG_FREE_IF_COPY(geom2, 1);
190 if ( empty1 != empty2 )
204 PG_RETURN_BOOL(result);
216 POSTGIS_DEBUG(2,
"lwgeom_ge called");
223 PG_FREE_IF_COPY(geom1, 0);
224 PG_FREE_IF_COPY(geom2, 1);
226 if ( empty1 != empty2 )
228 PG_RETURN_BOOL(
FALSE);
235 PG_RETURN_BOOL(
TRUE);
237 PG_RETURN_BOOL(
FALSE);
244 PG_RETURN_BOOL(
TRUE);
246 PG_RETURN_BOOL(
FALSE);
253 PG_RETURN_BOOL(
TRUE);
255 PG_RETURN_BOOL(
FALSE);
262 PG_RETURN_BOOL(
TRUE);
264 PG_RETURN_BOOL(
FALSE);
267 PG_RETURN_BOOL(
TRUE);
279 POSTGIS_DEBUG(2,
"lwgeom_gt called");
286 PG_FREE_IF_COPY(geom1, 0);
287 PG_FREE_IF_COPY(geom2, 1);
289 if ( empty1 != empty2 )
291 PG_RETURN_BOOL(
FALSE);
298 PG_RETURN_BOOL(
TRUE);
306 PG_RETURN_BOOL(
TRUE);
314 PG_RETURN_BOOL(
TRUE);
322 PG_RETURN_BOOL(
TRUE);
326 PG_RETURN_BOOL(
FALSE);
338 POSTGIS_DEBUG(2,
"lwgeom_cmp called");
345 PG_FREE_IF_COPY(geom1, 0);
346 PG_FREE_IF_COPY(geom2, 1);
348 if ( empty1 || empty2 )
350 if ( empty1 && empty2 )
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *box)
Read the bounding box off a serialization and calculate one if it is not already there.
Datum lwgeom_eq(PG_FUNCTION_ARGS)
Datum lwgeom_le(PG_FUNCTION_ARGS)
void error_if_srid_mismatch(int srid1, int srid2)
Datum lwgeom_lt(PG_FUNCTION_ARGS)
void gbox_init(GBOX *gbox)
Zero out all the entries in the GBOX.
Datum lwgeom_cmp(PG_FUNCTION_ARGS)
Datum lwgeom_gt(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(lwgeom_lt)
Datum lwgeom_ge(PG_FUNCTION_ARGS)
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)...
This library is the generic geometry handling section of PostGIS.