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

Definition at line 407 of file cu_libgeom.c.

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

Referenced by libgeom_suite_setup().

408 {
409  LWGEOM *geom;
410 
411  geom = lwgeom_from_wkt("MULTIPOINT(-1 -1,-1 2.5,2 2,2 -1)", LW_PARSER_CHECK_NONE);
412  CU_ASSERT_EQUAL(lwgeom_count_vertices(geom),4);
413  lwgeom_free(geom);
414 
415  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);
416  CU_ASSERT_EQUAL(lwgeom_count_vertices(geom),16);
417  lwgeom_free(geom);
418 
419  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);
420  CU_ASSERT_EQUAL(lwgeom_count_vertices(geom),30);
421  lwgeom_free(geom);
422 
423 }
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:890
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1869
int lwgeom_count_vertices(const LWGEOM *geom)
Count the total number of vertices in any LWGEOM.
Definition: lwgeom.c:1140

Here is the call graph for this function:

Here is the caller graph for this function: