PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_to_x3d3()

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

Definition at line 36 of file lwout_x3d.c.

37 {
38  stringbuffer_t *sb;
39  int rv;
40  char *result;
41 
42  /* Empty string for empties */
43  if( lwgeom_is_empty(geom) )
44  {
45  char *ret = NULL;
46  ret = lwalloc(1);
47  ret[0] = '\0';
48  return ret;
49  }
50 
51  sb = stringbuffer_create();
52  rv = lwgeom_to_x3d3_sb(geom, srs, precision, opts, defid, sb);
53 
54  if ( rv == LW_FAILURE )
55  {
57  return NULL;
58  }
59 
60  result = stringbuffer_getstringcopy(sb);
62 
63  return result;
64 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LW_FAILURE
Definition: liblwgeom.h:79
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition: lwgeom.c:1393
void * lwalloc(size_t size)
Definition: lwutil.c:229
static int lwgeom_to_x3d3_sb(const LWGEOM *geom, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:67
opts
Definition: ovdump.py:44
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
Definition: stringbuffer.c:35
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
Definition: stringbuffer.c:78
char * stringbuffer_getstringcopy(stringbuffer_t *s)
Returns a newly allocated string large enough to contain the current state of the string.
Definition: stringbuffer.c:160

References LW_FAILURE, lwalloc(), lwgeom_is_empty(), lwgeom_to_x3d3_sb(), ovdump::opts, precision, stringbuffer_create(), stringbuffer_destroy(), and stringbuffer_getstringcopy().

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: