PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ test_lwgeom_remove_irrelevant_points_for_view()

static void test_lwgeom_remove_irrelevant_points_for_view ( void  )
static

Definition at line 19 of file cu_remove_irrelevant_points_for_view.c.

20 {
21  LWGEOM *geom;
22  char *wkt, *in_wkt;
23  GBOX *bbox;
24 
25  bbox = gbox_new(0);
26  bbox->xmin = 12;
27  bbox->xmax = 18;
28  bbox->ymin = 12;
29  bbox->ymax = 18;
30 
31  geom = lwgeom_from_wkt("POLYGON((0 30, 15 30, 30 30, 30 0, 0 0, 0 30))", LW_PARSER_CHECK_NONE);
32  CU_ASSERT(geom != NULL);
33 
35  wkt = lwgeom_to_ewkt(geom);
36  in_wkt = "POLYGON((15 30,30 0,0 0,15 30))";
37  ASSERT_STRING_EQUAL(wkt, in_wkt);
38 
39  lwfree(wkt);
40  lwgeom_free(geom);
41  lwfree(bbox);
42 }
GBOX * gbox_new(lwflags_t flags)
Create a new gbox with the dimensionality indicated by the flags.
Definition: gbox.c:32
#define ASSERT_STRING_EQUAL(o, e)
void lwgeom_remove_irrelevant_points_for_view(LWGEOM *geom, GBOX *bbox, bool cartesian_hint)
remove points that are irrelevant for rendering the geometry within a view specified by rectangular b...
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1218
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:2146
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an allocated string.
Definition: lwgeom.c:565
void lwfree(void *mem)
Definition: lwutil.c:248
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:940
double ymax
Definition: liblwgeom.h:357
double xmax
Definition: liblwgeom.h:355
double ymin
Definition: liblwgeom.h:356
double xmin
Definition: liblwgeom.h:354

References ASSERT_STRING_EQUAL, gbox_new(), LW_PARSER_CHECK_NONE, lwfree(), lwgeom_free(), lwgeom_from_wkt(), lwgeom_remove_irrelevant_points_for_view(), lwgeom_to_ewkt(), GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.

Referenced by remove_irrelevant_points_for_view_suite_setup().

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