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

Definition at line 921 of file cu_algorithm.c.

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

Referenced by algorithms_suite_setup().

922 {
923  LWGEOM *l;
924  LWGEOM *i;
925  char *ewkt;
926 
927  /* Not simplifiable */
928  i = lwgeom_from_wkt("LINESTRING(0 0, 50 1.00001, 100 0)", LW_PARSER_CHECK_NONE);
929  l = lwgeom_simplify(i, 1.0);
930  ewkt = lwgeom_to_ewkt(l);
931  CU_ASSERT_STRING_EQUAL(ewkt, "LINESTRING(0 0,50 1.00001,100 0)");
932  lwgeom_free(l);
933  lwgeom_free(i);
934  lwfree(ewkt);
935 
936  /* Simplifiable */
937  i = lwgeom_from_wkt("LINESTRING(0 0,50 0.99999,100 0)", LW_PARSER_CHECK_NONE);
938  l = lwgeom_simplify(i, 1.0);
939  ewkt = lwgeom_to_ewkt(l);
940  CU_ASSERT_STRING_EQUAL(ewkt, "LINESTRING(0 0,100 0)");
941  lwgeom_free(l);
942  lwgeom_free(i);
943  lwfree(ewkt);
944 }
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: