Calculate covers predicate for two lwgeoms on the sphere.
Currently only handles point-in-polygon.
2414{
2415 int type1, type2;
2418
2419 assert(lwgeom1);
2420 assert(lwgeom2);
2421
2422 type1 = lwgeom1->
type;
2423 type2 = lwgeom2->
type;
2424
2425
2429 {
2430 LWDEBUG(4,
"dimension of geom2 is bigger than geom1");
2432 }
2433
2434
2435 if ( lwgeom1->
bbox )
2436 gbox1 = *(lwgeom1->
bbox);
2437 else
2439
2440
2441 if ( lwgeom2->
bbox )
2442 gbox2 = *(lwgeom2->
bbox);
2443 else
2445
2446
2447
2449 {
2453 }
2455 {
2457 }
2459 {
2461 }
2463 {
2465 }
2467 {
2469 }
2471 {
2473 }
2474
2475
2477 {
2478 uint32_t i;
2480
2481 for ( i = 0; i < col->
ngeoms; i++ )
2482 {
2484 {
2486 }
2487 }
2489 }
2490
2491
2493 {
2494 uint32_t i;
2496
2497 for ( i = 0; i < col->
ngeoms; i++ )
2498 {
2500 {
2502 }
2503 }
2505 }
2506
2507
2508 lwerror(
"lwgeom_covers_lwgeom_sphere: reached end of function without resolution");
2510
2511}
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 lwerror(const char *fmt,...)
Write a notice out to the error handler.