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

◆ test_lwgeom_voronoi_diagram_custom_envelope()

static void test_lwgeom_voronoi_diagram_custom_envelope ( void  )
static

Definition at line 66 of file cu_triangulate.c.

67{
68 LWGEOM *in = lwgeom_from_wkt("MULTIPOINT(4 4, 5 5, 6 6)", LW_PARSER_CHECK_NONE);
69 LWGEOM *for_extent = lwgeom_from_wkt("LINESTRING (-10 -10, 10 10)", LW_PARSER_CHECK_NONE);
70 const GBOX *clipping_extent = lwgeom_get_bbox(for_extent);
71
72 LWGEOM *out = lwgeom_voronoi_diagram(in, clipping_extent, 0, 0);
73 const GBOX *output_extent = lwgeom_get_bbox(out);
74
75 CU_ASSERT_TRUE(gbox_same(clipping_extent, output_extent));
76
77 lwgeom_free(in);
78 lwgeom_free(for_extent);
79 lwgeom_free(out);
80}
int gbox_same(const GBOX *g1, const GBOX *g2)
Check if 2 given Gbox are the same.
Definition gbox.c:164
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
#define LW_PARSER_CHECK_NONE
Definition liblwgeom.h:2149
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.
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
Definition lwgeom.c:771
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:940

References gbox_same(), LW_PARSER_CHECK_NONE, lwgeom_free(), lwgeom_from_wkt(), lwgeom_get_bbox(), and lwgeom_voronoi_diagram().

Referenced by triangulate_suite_setup().

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