14 #include "CUnit/Basic.h"
37 exp_wkt =
"GEOMETRYCOLLECTION(POLYGON((5 5,20 0,10 0,5 5)))";
38 if ( strcmp(wkt, exp_wkt) )
40 fprintf(stderr,
"\nExp: %s\nObt: %s\n", exp_wkt, wkt);
42 CU_ASSERT_STRING_EQUAL(wkt, exp_wkt);
48 #if POSTGIS_GEOS_VERSION >= 35
67 #if POSTGIS_GEOS_VERSION >= 35
75 CU_ASSERT_TRUE(
gbox_same(clipping_extent, output_extent));
83 #if POSTGIS_GEOS_VERSION >= 35
84 static void assert_empty_diagram(
char* wkt,
double tolerance)
99 #if POSTGIS_GEOS_VERSION >= 35
100 assert_empty_diagram(
"POLYGON EMPTY", 0);
101 assert_empty_diagram(
"POINT (1 2)", 0);
105 assert_empty_diagram(
"MULTIPOINT (0 0, 0 0.00001)", 0.001);
115 CU_pSuite suite = CU_add_suite(
"triangulate", NULL, NULL);
static void test_lwgeom_voronoi_diagram(void)
void triangulate_suite_setup(void)
static void test_lwgeom_voronoi_diagram_expected_empty(void)
static void test_lwgeom_voronoi_diagram_custom_envelope(void)
static void test_lwgeom_delaunay_triangulation(void)
int gbox_same(const GBOX *g1, const GBOX *g2)
Check if 2 given Gbox are the same.
void cu_error_msg_reset()
#define PG_ADD_TEST(suite, testfunc)
LWGEOM * lwgeom_delaunay_triangulation(const LWGEOM *geom, double tolerance, int32_t edgeOnly)
Take vertices of a geometry and build a delaunay triangulation on them.
void lwgeom_free(LWGEOM *geom)
#define LW_PARSER_CHECK_NONE
uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
LWGEOM * lwgeom_voronoi_diagram(const LWGEOM *g, const GBOX *env, double tolerance, int output_edges)
Take vertices of a geometry and build the Voronoi diagram.
LWGEOM * lwgeom_normalize(const LWGEOM *geom)
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)