PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_lwgeom_voronoi_diagram_custom_envelope()

static void test_lwgeom_voronoi_diagram_custom_envelope ( void  )
static

Definition at line 68 of file cu_triangulate.c.

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

Referenced by triangulate_suite_setup().

69 {
70 #if POSTGIS_GEOS_VERSION >= 35
71  LWGEOM* in = lwgeom_from_wkt("MULTIPOINT(4 4, 5 5, 6 6)", LW_PARSER_CHECK_NONE);
72  LWGEOM* for_extent = lwgeom_from_wkt("LINESTRING (-10 -10, 10 10)", LW_PARSER_CHECK_NONE);
73  const GBOX* clipping_extent = lwgeom_get_bbox(for_extent);
74 
75  LWGEOM* out = lwgeom_voronoi_diagram(in, clipping_extent, 0, 0);
76  const GBOX* output_extent = lwgeom_get_bbox(out);
77 
78  CU_ASSERT_TRUE(gbox_same(clipping_extent, output_extent));
79 
80  lwgeom_free(in);
81  lwgeom_free(for_extent);
82  lwgeom_free(out);
83 #endif /* POSTGIS_GEOS_VERSION >= 35 */
84 }
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
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:689
int gbox_same(const GBOX *g1, const GBOX *g2)
Check if 2 given Gbox are the same.
Definition: g_box.c:176
Here is the call graph for this function:
Here is the caller graph for this function: