770 char *in_ewkt, *out_ewkt;
776 in_ewkt =
"POLYGON((0 0,0 10,10 10,10 0,0 0))";
778 if (strcmp(in_ewkt, out_ewkt))
779 fprintf(stderr,
"\nExp: %s\nObt: %s\n", in_ewkt, out_ewkt);
780 CU_ASSERT_STRING_EQUAL(in_ewkt, out_ewkt);
788 in_ewkt =
"POLYGON((0 0,0 10,10 10,10 0,0 0))";
790 if (strcmp(in_ewkt, out_ewkt))
791 fprintf(stderr,
"\nExp: %s\nObt: %s\n", in_ewkt, out_ewkt);
792 CU_ASSERT_STRING_EQUAL(in_ewkt, out_ewkt);
797 geom =
lwgeom_from_wkt(
"POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,2 4,4 2,2 2),(6 2,8 2,8 4,6 2))",
LW_PARSER_CHECK_NONE);
800 in_ewkt =
"POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,2 4,2 2),(6 2,8 2,8 4,6 2))";
802 if (strcmp(in_ewkt, out_ewkt))
803 fprintf(stderr,
"\nExp: %s\nObt: %s\n", in_ewkt, out_ewkt);
804 CU_ASSERT_STRING_EQUAL(in_ewkt, out_ewkt);
809 geom =
lwgeom_from_wkt(
"POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,2 4,2 2),(6 2,8 4,8 2,6 2))",
LW_PARSER_CHECK_NONE);
812 in_ewkt =
"POLYGON((0 0,0 10,10 10,10 0,0 0),(2 2,4 2,2 4,2 2),(6 2,8 2,8 4,6 2))";
814 if (strcmp(in_ewkt, out_ewkt))
815 fprintf(stderr,
"\nExp: %s\nObt: %s\n", in_ewkt, out_ewkt);
816 CU_ASSERT_STRING_EQUAL(in_ewkt, out_ewkt);
822 in_ewkt =
"0103000000010000000500000000917E9BA468294100917E9B8AEA2841C976BE1FA4682941C976BE9F8AEA2841B39ABE1FA46829415ACCC29F8AEA284137894120A4682941C976BE9F8AEA284100917E9BA468294100917E9B8AEA2841";
char lwgeom_same(const LWGEOM *lwgeom1, const LWGEOM *lwgeom2)
geom1 same as geom2 iff
LWGEOM * lwgeom_from_hexwkb(const char *hexwkb, const char check)
void lwgeom_free(LWGEOM *geom)
#define LW_PARSER_CHECK_NONE
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
void lwgeom_force_clockwise(LWGEOM *lwgeom)
Force Right-hand-rule on LWGEOM polygons.
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
int lwgeom_is_clockwise(LWGEOM *lwgeom)
Ensure the outer ring is clockwise oriented and all inner rings are counter-clockwise.