2578 int type1, type2, polytype;
2584 geom1 = (
GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
2585 geom2 = (
GSERIALIZED *)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
2592 PG_RETURN_BOOL(
false);
2604 PG_RETURN_BOOL(
FALSE);
2617 POSTGIS_DEBUG(3,
"Point in Polygon test requested...short-circuiting.");
2623 serialized_poly = geom2;
2630 serialized_poly = geom1;
2651 elog(ERROR,
"Type isn't poly or multipoly!");
2657 PG_FREE_IF_COPY(geom1, 0);
2658 PG_FREE_IF_COPY(geom2, 1);
2661 PG_RETURN_BOOL(
TRUE);
2665 PG_RETURN_BOOL(
FALSE);
2674 if ( prep_cache->
argnum == 1 )
2682 result = GEOSPreparedIntersects( prep_cache->
prepared_geom, g);
2683 GEOSGeom_destroy(g);
2693 result = GEOSPreparedIntersects( prep_cache->
prepared_geom, g);
2694 GEOSGeom_destroy(g);
2711 GEOSGeom_destroy(g1);
2714 result = GEOSIntersects( g1, g2);
2715 GEOSGeom_destroy(g1);
2716 GEOSGeom_destroy(g2);
2725 PG_FREE_IF_COPY(geom1, 0);
2726 PG_FREE_IF_COPY(geom2, 1);
2728 PG_RETURN_BOOL(result);
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.
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
const GEOSPreparedGeometry * prepared_geom
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void error_if_srid_mismatch(int srid1, int srid2)
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
The tree structure used for fast P-i-P tests by point_in_multipolygon_rtree()
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
int point_in_multipolygon_rtree(RTREE_NODE **root, int polyCount, int *ringCounts, LWPOINT *point)
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
int point_in_multipolygon(LWMPOLY *mpolygon, LWPOINT *point)
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
void lwgeom_geos_error(const char *fmt,...)
int point_in_polygon(LWPOLY *polygon, LWPOINT *point)
int gbox_overlaps_2d(const GBOX *g1, const GBOX *g2)
Return LW_TRUE if the GBOX overlaps on the 2d plane, LW_FALSE otherwise.
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
PrepGeomCache * GetPrepGeomCache(FunctionCallInfoData *fcinfo, GSERIALIZED *g1, GSERIALIZED *g2)
Given a couple potential geometries and a function call context, return a prepared structure for one ...
RTREE_NODE ** ringIndices
RTREE_POLY_CACHE * GetRtreeCache(FunctionCallInfoData *fcinfo, GSERIALIZED *g1)
Checks for a cache hit against the provided geometry and returns a pre-built index structure (RTREE_P...
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)...
void errorIfGeometryCollection(GSERIALIZED *g1, GSERIALIZED *g2)
Throws an ereport ERROR if either geometry is a COLLECTIONTYPE.