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

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

References gridspec_t::ipx, gridspec_t::ipy, LW_PARSER_CHECK_ALL, lwfree(), lwgeom_free(), lwgeom_from_wkt(), lwgeom_grid(), lwgeom_to_ewkt(), gridspec_t::xsize, and gridspec_t::ysize.

Referenced by misc_suite_setup().

123 {
124  gridspec grid;
125  static char *wkt = "MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)))";
127  LWGEOM *geomgrid;
128  char *str;
129 
130  grid.ipx = grid.ipy = 0;
131  grid.xsize = grid.ysize = 20;
132 
133  geomgrid = lwgeom_grid(geom, &grid);
134  str = lwgeom_to_ewkt(geomgrid);
135  CU_ASSERT_STRING_EQUAL(str, "MULTIPOLYGON EMPTY");
136  lwfree(str);
137  lwgeom_free(geom);
138  lwgeom_free(geomgrid);
139 }
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:1868
void lwfree(void *mem)
Definition: lwutil.c:214
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:469
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_ALL
Definition: liblwgeom.h:1870
Snap to grid.

Here is the call graph for this function:

Here is the caller graph for this function: