PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ test_lwgeom_delaunay_triangulation()

static void test_lwgeom_delaunay_triangulation ( void  )
static

Definition at line 21 of file cu_triangulate.c.

22{
23 LWGEOM *in, *tmp, *out;
24 char *wkt, *exp_wkt;
25
26 /* Because i don't trust that much prior tests... ;) */
28
29 in = lwgeom_from_wkt("MULTIPOINT(10 0, 20 0, 5 5)", LW_PARSER_CHECK_NONE);
30
31 tmp = lwgeom_delaunay_triangulation(in, 0, 0);
32 lwgeom_free(in);
33 out = lwgeom_normalize(tmp);
34 lwgeom_free(tmp);
35
36 wkt = lwgeom_to_ewkt(out);
37 lwgeom_free(out);
38
39 exp_wkt = "GEOMETRYCOLLECTION(POLYGON((5 5,20 0,10 0,5 5)))";
40 if (strcmp(wkt, exp_wkt))
41 fprintf(stderr, "\nExp: %s\nObt: %s\n", exp_wkt, wkt);
42
43 ASSERT_STRING_EQUAL(wkt, exp_wkt);
44 lwfree(wkt);
45}
void cu_error_msg_reset()
#define ASSERT_STRING_EQUAL(o, e)
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2149
LWGEOM * lwgeom_delaunay_triangulation(const LWGEOM *geom, double tolerance, int32_t edgeOnly)
Take vertices of a geometry and build a delaunay triangulation on them.
LWGEOM * lwgeom_normalize(const LWGEOM *geom)
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an allocated string.
Definition lwgeom.c:593
void lwfree(void *mem)
Definition lwutil.c:248
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:940

References ASSERT_STRING_EQUAL, cu_error_msg_reset(), LW_PARSER_CHECK_NONE, lwfree(), lwgeom_delaunay_triangulation(), lwgeom_free(), lwgeom_from_wkt(), lwgeom_normalize(), and lwgeom_to_ewkt().

Referenced by triangulate_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: