PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_grid()

static void test_grid ( void  )
static

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

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 }
#define LW_PARSER_CHECK_ALL
Definition: liblwgeom.h:2006
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an alloced string.
Definition: lwgeom.c:556
void lwfree(void *mem)
Definition: lwutil.c:244
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:904
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:2253
Snap to grid.

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().

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