PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ lwgeom_to_text()

static char* lwgeom_to_text ( const LWGEOM geom,
int  prec 
)
static

Definition at line 34 of file cu_lwstroke.c.

References lwgeom_free(), lwgeom_grid(), lwgeom_to_wkt(), WKT_ISO, gridspec_t::xsize, and gridspec_t::ysize.

Referenced by test_lwcurve_linearize().

35 {
36  gridspec grid;
37  LWGEOM *gridded;
38  char *wkt;
39 
40  memset(&grid, 0, sizeof(gridspec));
41  grid.xsize = prec;
42  grid.ysize = prec;
43  gridded = lwgeom_grid(geom, &grid);
44 
45  wkt = lwgeom_to_wkt(gridded, WKT_ISO, 15, NULL);
46  lwgeom_free(gridded);
47  return wkt;
48 }
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:2243
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
Definition: lwout_wkt.c:675
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
#define WKT_ISO
Definition: liblwgeom.h:2074
Snap to grid.
Here is the call graph for this function:
Here is the caller graph for this function: