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

Definition at line 812 of file cu_libgeom.c.

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

Referenced by libgeom_suite_setup().

813 {
814  LWGEOM *geom;
815 
816  geom = lwgeom_from_wkt("POLYGON((0 0, 10 0, 10 10, 0 10, 0 0))", LW_PARSER_CHECK_NONE);
817  CU_ASSERT( !lwgeom_is_empty(geom) );
818  lwgeom_free(geom);
819 
820  geom = lwgeom_from_wkt("POINT EMPTY", LW_PARSER_CHECK_NONE);
821  CU_ASSERT( lwgeom_is_empty(geom) );
822  lwgeom_free(geom);
823 
824  geom = lwgeom_from_wkt("LINESTRING EMPTY", LW_PARSER_CHECK_NONE);
825  CU_ASSERT( lwgeom_is_empty(geom) );
826  lwgeom_free(geom);
827 
828  geom = lwgeom_from_wkt("POLYGON EMPTY", LW_PARSER_CHECK_NONE);
829  CU_ASSERT( lwgeom_is_empty(geom) );
830  lwgeom_free(geom);
831 
832  geom = lwgeom_from_wkt("MULTIPOINT EMPTY", LW_PARSER_CHECK_NONE);
833  CU_ASSERT( lwgeom_is_empty(geom) );
834  lwgeom_free(geom);
835 
836  geom = lwgeom_from_wkt("MULTILINESTRING EMPTY", LW_PARSER_CHECK_NONE);
837  CU_ASSERT( lwgeom_is_empty(geom) );
838  lwgeom_free(geom);
839 
840  geom = lwgeom_from_wkt("MULTIPOLYGON EMPTY", LW_PARSER_CHECK_NONE);
841  CU_ASSERT( lwgeom_is_empty(geom) );
842  lwgeom_free(geom);
843 
844  geom = lwgeom_from_wkt("GEOMETRYCOLLECTION(GEOMETRYCOLLECTION EMPTY, POINT EMPTY, LINESTRING EMPTY, POLYGON EMPTY, MULTIPOINT EMPTY, MULTILINESTRING EMPTY, MULTIPOLYGON EMPTY, GEOMETRYCOLLECTION(MULTIPOLYGON EMPTY))", LW_PARSER_CHECK_NONE);
845  CU_ASSERT( lwgeom_is_empty(geom) );
846  lwgeom_free(geom);
847 
848 }
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_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1297

Here is the call graph for this function:

Here is the caller graph for this function: