PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_lwgeom_voronoi_diagram()

static void test_lwgeom_voronoi_diagram ( void  )
static

Definition at line 49 of file cu_triangulate.c.

References COLLECTIONTYPE, LW_PARSER_CHECK_NONE, lwgeom_free(), lwgeom_from_wkt(), lwgeom_get_type(), lwgeom_voronoi_diagram(), and MULTILINETYPE.

Referenced by triangulate_suite_setup().

50 {
51 #if POSTGIS_GEOS_VERSION >= 35
52  LWGEOM* in = lwgeom_from_wkt("MULTIPOINT(4 4, 5 5, 6 6)", LW_PARSER_CHECK_NONE);
53 
54  LWGEOM* out_boundaries = lwgeom_voronoi_diagram(in, NULL, 0, 0);
55  LWGEOM* out_lines = lwgeom_voronoi_diagram(in, NULL, 0, 1);
56 
57  /* For boundaries we get a generic LWCOLLECTION */
58  CU_ASSERT_EQUAL(COLLECTIONTYPE, lwgeom_get_type(out_boundaries));
59  /* For lines we get a MULTILINETYPE */
60  CU_ASSERT_EQUAL(MULTILINETYPE, lwgeom_get_type(out_lines));
61 
62  lwgeom_free(in);
63  lwgeom_free(out_boundaries);
64  lwgeom_free(out_lines);
65 #endif /* POSTGIS_GEOS_VERSION >= 35 */
66 }
uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
Definition: lwgeom.c:878
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
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.
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2013
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the call graph for this function:
Here is the caller graph for this function: