PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ test_grid()

static void test_grid ( void  )
static

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

108 {
109  gridspec grid;
110  static char *wkt = "MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)))";
112  LWGEOM *geomgrid;
113  char *str;
114 
115  grid.ipx = grid.ipy = 0;
116  grid.xsize = grid.ysize = 20;
117 
118  geomgrid = lwgeom_grid(geom, &grid);
119  str = lwgeom_to_ewkt(geomgrid);
120  CU_ASSERT_STRING_EQUAL(str, "MULTIPOLYGON EMPTY");
121  lwfree(str);
122  lwgeom_free(geom);
123  lwgeom_free(geomgrid);
124 }
#define LW_PARSER_CHECK_ALL
Definition: liblwgeom.h:2086
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:548
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:2244
#define str(s)
double ysize
Definition: liblwgeom.h:1372
double xsize
Definition: liblwgeom.h:1371
double ipx
Definition: liblwgeom.h:1367
double ipy
Definition: liblwgeom.h:1368
Snap-to-grid.
Definition: liblwgeom.h:1366

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: