PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void test_lwpoly_covers_point2d ( void  )
static

Definition at line 1096 of file cu_geodetic.c.

References LW_PARSER_CHECK_NONE, LW_TRUE, lwgeom_free(), lwgeom_from_wkt(), lwpoly_covers_point2d(), result, POINT2D::x, and POINT2D::y.

Referenced by geodetic_suite_setup().

1097 {
1098  LWPOLY *poly;
1099  LWGEOM *lwg;
1100  POINT2D pt_to_test;
1101  int result;
1102 
1103  lwg = lwgeom_from_wkt("POLYGON((-9 50,51 -11,-10 50,-9 50))", LW_PARSER_CHECK_NONE);
1104  poly = (LWPOLY*)lwg;
1105  pt_to_test.x = -10.0;
1106  pt_to_test.y = 50.0;
1107  result = lwpoly_covers_point2d(poly, &pt_to_test);
1108  CU_ASSERT_EQUAL(result, LW_TRUE);
1109  lwgeom_free(lwg);
1110 
1111  /* Great big ring */
1112  lwg = lwgeom_from_wkt("POLYGON((-40.0 52.0, 102.0 -6.0, -67.0 -29.0, -40.0 52.0))", LW_PARSER_CHECK_NONE);
1113  poly = (LWPOLY*)lwg;
1114  pt_to_test.x = 4.0;
1115  pt_to_test.y = 11.0;
1116  result = lwpoly_covers_point2d(poly, &pt_to_test);
1117  CU_ASSERT_EQUAL(result, LW_TRUE);
1118  lwgeom_free(lwg);
1119 
1120 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:844
char ** result
Definition: liblwgeom.h:218
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1706
double x
Definition: liblwgeom.h:284
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:51
double y
Definition: liblwgeom.h:284
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...
Definition: lwgeodetic.c:2384

Here is the call graph for this function:

Here is the caller graph for this function: