PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void test_misc_simplify ( void  )
static

Definition at line 45 of file liblwgeom/cunit/cu_misc.c.

References LW_PARSER_CHECK_NONE, lwfree(), lwgeom_free(), lwgeom_from_wkt(), lwgeom_simplify(), and lwgeom_to_ewkt().

Referenced by misc_suite_setup().

46 {
47  LWGEOM *geom;
48  LWGEOM *geom2d;
49  char *wkt_out;
50 
51  geom = lwgeom_from_wkt("LINESTRING(0 0,0 10,0 51,50 20,30 20,7 32)", LW_PARSER_CHECK_NONE);
52  geom2d = lwgeom_simplify(geom,2);
53  wkt_out = lwgeom_to_ewkt(geom2d);
54  CU_ASSERT_STRING_EQUAL("LINESTRING(0 0,0 51,50 20,30 20,7 32)",wkt_out);
55  lwgeom_free(geom);
56  lwgeom_free(geom2d);
57  lwfree(wkt_out);
58 
59  geom = lwgeom_from_wkt("MULTILINESTRING((0 0,0 10,0 51,50 20,30 20,7 32))", LW_PARSER_CHECK_NONE);
60  geom2d = lwgeom_simplify(geom,2);
61  wkt_out = lwgeom_to_ewkt(geom2d);
62  CU_ASSERT_STRING_EQUAL("MULTILINESTRING((0 0,0 51,50 20,30 20,7 32))",wkt_out);
63  lwgeom_free(geom);
64  lwgeom_free(geom2d);
65  lwfree(wkt_out);
66 }
void lwfree(void *mem)
Definition: lwutil.c:190
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:425
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:844
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1706
LWGEOM * lwgeom_simplify(const LWGEOM *igeom, double dist)
Definition: lwgeom.c:1478

Here is the call graph for this function:

Here is the caller graph for this function: