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

Definition at line 399 of file cu_libgeom.c.

References LW_PARSER_CHECK_NONE, lwgeom_count_vertices(), lwgeom_free(), and lwgeom_from_wkt().

Referenced by libgeom_suite_setup().

400 {
401  LWGEOM *geom;
402 
403  geom = lwgeom_from_wkt("MULTIPOINT(-1 -1,-1 2.5,2 2,2 -1)", LW_PARSER_CHECK_NONE);
404  CU_ASSERT_EQUAL(lwgeom_count_vertices(geom),4);
405  lwgeom_free(geom);
406 
407  geom = lwgeom_from_wkt("SRID=1;MULTILINESTRING((-1 -131,-1 2.5,2 2,2 -1),(-1 -1,-1 2.5,2 2,2 -1),(-1 -1,-1 2.5,2 2,2 -1),(-1 -1,-1 2.5,2 2,2 -1))", LW_PARSER_CHECK_NONE);
408  CU_ASSERT_EQUAL(lwgeom_count_vertices(geom),16);
409  lwgeom_free(geom);
410 
411  geom = lwgeom_from_wkt("SRID=4326;MULTIPOLYGON(((-1 -1,-1 2.5,211 2,2 -1,-1 -1),(0 0,0 1,1 1,1 0,0 0),(-0.5 -0.5,-0.5 -0.4,-0.4 -0.4,-0.4 -0.5,-0.5 -0.5)),((-1 -1,-1 2.5,2 2,2 -1,-1 -1),(0 0,0 1,1 1,1 0,0 0),(-0.5 -0.5,-0.5 -0.4,-0.4 -0.4,-0.4 -0.5,-0.5 -0.5)))", LW_PARSER_CHECK_NONE);
412  CU_ASSERT_EQUAL(lwgeom_count_vertices(geom),30);
413  lwgeom_free(geom);
414 
415 }
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
int lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1072

Here is the call graph for this function:

Here is the caller graph for this function: