PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ test_lwgeom_voronoi_diagram_custom_envelope()

static void test_lwgeom_voronoi_diagram_custom_envelope ( void  )
static

Definition at line 65 of file cu_triangulate.c.

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

Referenced by triangulate_suite_setup().

66 {
67 #if POSTGIS_GEOS_VERSION >= 35
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 #endif /* POSTGIS_GEOS_VERSION >= 35 */
81 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1128
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:1966
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:725
int gbox_same(const GBOX *g1, const GBOX *g2)
Check if 2 given Gbox are the same.
Definition: g_box.c:171
Here is the call graph for this function:
Here is the caller graph for this function: