PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ test_grid()

static void test_grid ( void  )
static

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

131 {
132  gridspec grid;
133  static char *wkt = "MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)))";
135  LWGEOM *geomgrid;
136  char *str;
137 
138  grid.ipx = grid.ipy = 0;
139  grid.xsize = grid.ysize = 20;
140 
141  geomgrid = lwgeom_grid(geom, &grid);
142  str = lwgeom_to_ewkt(geomgrid);
143  CU_ASSERT_STRING_EQUAL(str, "MULTIPOLYGON EMPTY");
144  lwfree(str);
145  lwgeom_free(geom);
146  lwgeom_free(geomgrid);
147 }
#define LW_PARSER_CHECK_ALL
Definition: liblwgeom.h:2061
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1138
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:547
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:2245
#define str(s)
double ysize
Definition: liblwgeom.h:1347
double xsize
Definition: liblwgeom.h:1346
double ipx
Definition: liblwgeom.h:1342
double ipy
Definition: liblwgeom.h:1343
Snap-to-grid.
Definition: liblwgeom.h:1341

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: