PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ do_grid_test()

static void do_grid_test ( const char *  wkt_in,
const char *  wkt_out,
double  size 
)
static

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

142 {
143  char *wkt_result, *wkt_norm;
144  gridspec grid;
147  wkt_norm = lwgeom_to_ewkt(go);
148  memset(&grid, 0, sizeof(gridspec));
149  grid.xsize = grid.ysize = grid.zsize = grid.msize = size;
150  lwgeom_grid_in_place(g, &grid);
151  wkt_result = lwgeom_to_ewkt(g);
152  // printf("%s ==%ld==> %s == %s\n", wkt_in, lround(size), wkt_result, wkt_out);
153  CU_ASSERT_STRING_EQUAL(wkt_result, wkt_norm);
154  lwfree(wkt_result);
155  lwfree(wkt_norm);
156  lwgeom_free(g);
157  lwgeom_free(go);
158 }
#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
void lwgeom_grid_in_place(LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:2152
Snap to grid.

References LW_PARSER_CHECK_ALL, lwfree(), lwgeom_free(), lwgeom_from_wkt(), lwgeom_grid_in_place(), lwgeom_to_ewkt(), gridspec_t::msize, gridspec_t::xsize, gridspec_t::ysize, and gridspec_t::zsize.

Referenced by test_grid_in_place().

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