PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ test_grid()

static void test_grid ( void  )
static

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

140 {
141  gridspec grid;
142  static char *wkt = "MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)))";
144  LWGEOM *geomgrid;
145  char *str;
146 
147  grid.ipx = grid.ipy = 0;
148  grid.xsize = grid.ysize = 20;
149 
150  geomgrid = lwgeom_grid(geom, &grid);
151  str = lwgeom_to_ewkt(geomgrid);
152  CU_ASSERT_STRING_EQUAL(str, "MULTIPOLYGON EMPTY");
153  lwfree(str);
154  lwgeom_free(geom);
155  lwgeom_free(geomgrid);
156 }
#define LW_PARSER_CHECK_ALL
Definition: liblwgeom.h:2115
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:565
void lwfree(void *mem)
Definition: lwutil.c:242
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:905
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:2267
#define str(s)
double ysize
Definition: liblwgeom.h:1381
double xsize
Definition: liblwgeom.h:1380
double ipx
Definition: liblwgeom.h:1376
double ipy
Definition: liblwgeom.h:1377
Snap-to-grid.
Definition: liblwgeom.h:1375

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

Referenced by misc_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: