PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwgeom_to_x3d3()

lwvarlena_t* lwgeom_to_x3d3 ( const LWGEOM geom,
int  precision,
int  opts,
const char *  defid 
)

Definition at line 37 of file lwout_x3d.c.

38 {
39  stringbuffer_t *sb;
40  int rv;
41 
42  /* Empty varlena for empties */
43  if( lwgeom_is_empty(geom) )
44  {
47  return v;
48  }
49 
50  sb = stringbuffer_create();
51  rv = lwgeom_to_x3d3_sb(geom, precision, opts, defid, sb);
52 
53  if ( rv == LW_FAILURE )
54  {
56  return NULL;
57  }
58 
61 
62  return v;
63 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LWVARHDRSZ
Definition: liblwgeom.h:311
#define LW_FAILURE
Definition: liblwgeom.h:96
#define LWSIZE_SET(varsize, len)
Definition: liblwgeom.h:325
void * lwalloc(size_t size)
Definition: lwutil.c:227
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition: lwinline.h:203
static int lwgeom_to_x3d3_sb(const LWGEOM *geom, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:66
opts
Definition: ovdump.py:45
lwvarlena_t * stringbuffer_getvarlenacopy(stringbuffer_t *s)
Definition: stringbuffer.c:151
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
Definition: stringbuffer.c:33
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
Definition: stringbuffer.c:85
uint32_t size
Definition: liblwgeom.h:307

References LW_FAILURE, lwalloc(), lwgeom_is_empty(), lwgeom_to_x3d3_sb(), LWSIZE_SET, LWVARHDRSZ, ovdump::opts, precision, lwvarlena_t::size, stringbuffer_create(), stringbuffer_destroy(), and stringbuffer_getvarlenacopy().

Referenced by do_x3d3_test(), do_x3d3_unsupported(), and LWGEOM_asX3D().

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