Calculate covers predicate for two lwgeoms on the sphere.
Currently only handles point-in-polygon.
2293{
2294 int type1, type2;
2297
2298 assert(lwgeom1);
2299 assert(lwgeom2);
2300
2301 type1 = lwgeom1->
type;
2302 type2 = lwgeom2->
type;
2303
2304
2308 {
2309 LWDEBUG(4,
"dimension of geom2 is bigger than geom1");
2311 }
2312
2313
2314 if ( lwgeom1->
bbox )
2315 gbox1 = *(lwgeom1->
bbox);
2316 else
2318
2319
2320 if ( lwgeom2->
bbox )
2321 gbox2 = *(lwgeom2->
bbox);
2322 else
2324
2325
2326
2328 {
2332 }
2334 {
2336 }
2338 {
2340 }
2342 {
2344 }
2346 {
2348 }
2350 {
2352 }
2353
2354
2356 {
2357 uint32_t i;
2359
2360 for ( i = 0; i < col->
ngeoms; i++ )
2361 {
2363 {
2365 }
2366 }
2368 }
2369
2370
2372 {
2373 uint32_t i;
2375
2376 for ( i = 0; i < col->
ngeoms; i++ )
2377 {
2379 {
2381 }
2382 }
2384 }
2385
2386
2387 lwerror(
"lwgeom_covers_lwgeom_sphere: reached end of function without resolution");
2389
2390}
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define LW_TRUE
Return types for functions with status returns.
char lwpoint_same(const LWPOINT *p1, const LWPOINT *p2)
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...
int lwline_covers_lwpoint(const LWLINE *lwline, const LWPOINT *lwpoint)
return LW_TRUE if any of the line segments covers the point
int lwpoly_covers_lwpoly(const LWPOLY *poly1, const LWPOLY *poly2)
Given a polygon1 check if all points of polygon2 are inside polygon1 and no intersections of the poly...
int lwgeom_calculate_gbox_geodetic(const LWGEOM *geom, GBOX *gbox)
Calculate the geodetic bounding box for an LWGEOM.
int lwpoly_covers_lwline(const LWPOLY *poly, const LWLINE *line)
int lwgeom_covers_lwgeom_sphere(const LWGEOM *lwgeom1, const LWGEOM *lwgeom2)
Calculate covers predicate for two lwgeoms on the sphere.
int lwline_covers_lwline(const LWLINE *lwline1, const LWLINE *lwline2)
Check if first and last point of line2 are covered by line1 and then each point in between has to be ...
#define LWDEBUG(level, msg)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.