PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ test_grid()

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:1912
void lwfree(void *mem)
Definition: lwutil.c:244
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:518
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
#define LW_PARSER_CHECK_ALL
Definition: liblwgeom.h:2014
Snap to grid.
Here is the call graph for this function:
Here is the caller graph for this function: