PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ do_grid_test()

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

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

159{
160 char *wkt_result, *wkt_norm;
161 gridspec grid;
164 wkt_norm = lwgeom_to_ewkt(go);
165 memset(&grid, 0, sizeof(gridspec));
166 grid.xsize = grid.ysize = grid.zsize = grid.msize = size;
167 lwgeom_grid_in_place(g, &grid);
168 wkt_result = lwgeom_to_ewkt(g);
169 // printf("%s ==%ld==> %s == %s\n", wkt_in, lround(size), wkt_result, wkt_out);
170 ASSERT_STRING_EQUAL(wkt_result, wkt_norm);
171 lwfree(wkt_result);
172 lwfree(wkt_norm);
173 lwgeom_free(g);
174 lwgeom_free(go);
175}
#define ASSERT_STRING_EQUAL(o, e)
#define LW_PARSER_CHECK_ALL
Definition liblwgeom.h:2150
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
char * lwgeom_to_ewkt(const LWGEOM *lwgeom)
Return an allocated string.
Definition lwgeom.c:593
void lwfree(void *mem)
Definition lwutil.c:248
void lwgeom_grid_in_place(LWGEOM *lwgeom, gridspec *grid)
Definition lwgeom.c:2317
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition lwin_wkt.c:940
double zsize
Definition liblwgeom.h:1407
double ysize
Definition liblwgeom.h:1406
double xsize
Definition liblwgeom.h:1405
double msize
Definition liblwgeom.h:1408
Snap-to-grid.
Definition liblwgeom.h:1400

References ASSERT_STRING_EQUAL, 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: