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

◆ lwgeom_to_x3d3()

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

Definition at line 36 of file lwout_x3d.c.

37{
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
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:110
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:193
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
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
char * stringbuffer_getstringcopy(stringbuffer_t *s)
Returns a newly allocated string large enough to contain the current state of the string.
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.

References LW_FAILURE, lwalloc(), lwgeom_is_empty(), lwgeom_to_x3d3_sb(), 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: