Calculate covers predicate for two lwgeoms on the sphere.
Currently only handles point-in-polygon.
Definition at line 2314 of file lwgeodetic.c.
References LWGEOM::bbox, COLLECTIONTYPE, GBOX::flags, LWCOLLECTION::geoms, getPoint2d_p(), LW_FALSE, LW_TRUE, lwerror(), lwgeom_calculate_gbox_geodetic(), lwpoly_covers_point2d(), lwtype_is_collection(), MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, POINTTYPE, POLYGONTYPE, and LWGEOM::type.
Referenced by geography_covers().
2323 type1 = lwgeom1->
type;
2324 type2 = lwgeom2->
type;
2330 lwerror(
"lwgeom_covers_lwgeom_sphere: only POLYGON covers POINT tests are currently supported");
2335 if ( lwgeom1->
bbox )
2336 gbox1 = *(lwgeom1->
bbox);
2341 if ( lwgeom2->
bbox )
2342 gbox2 = *(lwgeom2->
bbox);
2361 for ( i = 0; i < col->
ngeoms; i++ )
2377 for ( i = 0; i < col->
ngeoms; i++ )
2388 lwerror(
"lwgeom_covers_lwgeom_sphere: reached end of function without resolution");
int lwgeom_covers_lwgeom_sphere(const LWGEOM *lwgeom1, const LWGEOM *lwgeom2)
Calculate covers predicate for two lwgeoms on the sphere.
#define LW_TRUE
Return types for functions with status returns.
int lwgeom_calculate_gbox_geodetic(const LWGEOM *geom, GBOX *gbox)
Calculate the geodetic bounding box for an LWGEOM.
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
int lwpoly_covers_point2d(const LWPOLY *poly, const POINT2D *pt_to_test)
Given a polygon (lon/lat decimal degrees) and point (lon/lat decimal degrees) and a guaranteed outsid...
void lwerror(const char *fmt,...)
Write a notice out to the error handler.